c# - Jquery toggle individual item in repeater -
hope question understandable.
i have repeater several rows database, , each row has picture , button
like this:
<asp:repeater runat="server" datasourceid="sqldatasource1" id="repeater1"> <itemtemplate> <div class="col-lg-2 col-md-2 col-sm-4 col-xs-6" style="height: 200px;"> <div class="thumbnail text-center sletbox"> <img class="img-responsive" src='../fotos/<%# eval("url") %>' alt=""></a> <div class="slet"> <a href='delete_picture.aspx?id=<%# eval("pic_id") %>&a=<%# eval("album") %>&n=<%# eval("url") %>' onclick="return confirm('vil du slette dette billed?')"> <h3 class="btn btn-danger btn-xs" id="contact">slet</h3> </a> </div> </div> </div> <!-- col-lg-4 --> </itemtemplate> </asp:repeater>
then have made jquery function makes the button appear hover, , works fine.
<script> $(document).ready(function () { $(".slet").hide(); $(".sletbox").hover(function () { $(".slet").fadetoggle(50); }); }); </script>
but problem makes buttons appear, not 1 you're hovering.
so how make 1 you're hovering appear?
try below code:
$(document).ready(function () { $(".slet").hide(); $(".sletbox").hover(function () { $(this).find(".slet").fadetoggle(50); //locating associated .slet , not one. }); });
Comments
Post a Comment