我正在尝试实现悬停效果我尝试了此代码但无法正常工作
$('.real').parent().on('mouseenter', function () {
var href = $(this).attr('href');
var top = $(this).next().css("bottom");
$(this).find('.real').next().css("display", "block").next().css({
'display': 'block',
'top': '30px'
});
}).on('mouseleave', function () {
var element = $(this).find('.real').next().css("display", "none");
element.next().css({
'display': 'none',
'top': '30px'
});
});
$('.SelectionAnimate').hover(function () {
$(this).css("display", "block");
$(this).next().show();
});
列表视图代码
<div style="float: left; position: relative; margin: 10px;">
<div>
<a class="real" href='<%#"/ProfileTenModified/UserProfile/PhotoCross.aspx?in="+ Eval("Full_Image_Name") +"&mi=" + Eval("User_Id") +"&fd="+ Eval("Album")%>'>
<asp:Image ID="Image1" runat="server" ImageUrl='<%#"/ProfileTenModified/setP/"+ Eval("Slide_Thumb_Name") +".JPEG" %>'
BorderStyle="Solid" BorderWidth="1px" Width="172px" Height="172px" />
</a>
<asp:LinkButton CssClass="SelectionAnimate" ID="Selection" runat="server" Text="Set as Display"
OnCommand="ListViewThums_Selection_Command" CommandName="selection"></asp:LinkButton>
<asp:LinkButton CssClass="SelectionAnimate" ID="Deletion" runat="server" Text="Remove"
OnCommand="ListViewThumbs_Command"></asp:LinkButton>
</div>
<asp:HiddenField ID="HiddenFieldImageId" runat="server" Value='<%#Eval("Id") %>' />
</div>
当我使用hover
它时,它可以工作但不能与mouseenter
.. 有什么问题?