日期:2014-05-17 浏览次数:20432 次
<script type="text/javascript" language="javascript"> function ChangeDiv(link, index) { link = $(link); link.addClass("v").siblings("a").removeClass("v"); $("#div-" + index).show().siblings("div[id|='div']").hide(); return false; } </script> <div> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 1);" Text="问题1"></asp:LinkButton> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 2);" Text="问题2"></asp:LinkButton> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 3);" Text="问题3"></asp:LinkButton> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 4);" Text="问题4"></asp:LinkButton> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 5);" Text="问题5"></asp:LinkButton> </div> <div id="div-1">具体问题1</div> <div id="div-2">具体问题2</div> <div id="div-3">具体问题3</div> <div id="div-4">具体问题4</div> <div id="div-5">具体问题5</div>
<script type="text/javascript" language="javascript"> function ChangeDiv(link, index) { link = $(link); link.addClass("v").siblings("a").removeClass("v"); $("#divD" + index).show().siblings("div[id|='div']").hide(); return false; } </script> <div> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 1);" Text="问题1"></asp:LinkButton> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 2);" Text="问题2"></asp:LinkButton> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 3);" Text="问题3"></asp:LinkButton> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 4);" Text="问题4"></asp:LinkButton> <asp:LinkButton runat="server" OnClientClick="return ChangeDiv(this, 5);" Text="问题5"></asp:LinkButton> </div> <div id="divD1" runat="server" >具体问题1</div> <div id="divD2" runat="server">具体问题2</div> <div id="divD3" runat="server">具体问题3</div> <div id="divD4" runat="server">具体问题4</div> <div id="divD5" runat="server">具体问题5</div>