How can I SlideToogle in repeater with anchor or linkbutton?

azile

New Member
I have a repeater, anchor tag and div tag inside it. The anchor has a jquery which is doing slidetoggle. But for example if I have 5 items in repeater div count is also 5 and when I click the anchor all divs are doing slidetoggle.If I use itemcommand it's ok, but this time js is not working. Because I'm using linkbutton and it has no click event as you know. So is there any solution to fix it?Here is my repeater and js.\[code\]<head runat="server"> <title></title> <script src="http://stackoverflow.com/questions/14066767/jquery-1.8.4.js"></script> <script src="http://stackoverflow.com/questions/14066767/jquery-ui-1.9.2.custom.js"></script> <script src="http://stackoverflow.com/questions/14066767/jquery-ui-1.9.2.custom.min.js"></script> <script> $(function () { $('[id*=aNotice]').click(function () { $('[id*=dvContent]').slideToggle(400); }); }); </script></head><body> <form id="form1" runat="server"> <div> <asp:Repeater ID="rptNotice" runat="server"> <ItemTemplate> <a id="aNotice" runat="server">click to see toggle</a> <div id="dvContent" runat="server"><%#Eval("content") %></div> </ItemTemplate> </asp:Repeater> </div> </form></body></html>\[/code\]
 
Back
Top