我試圖讓我的功能沒有成功。我所需要的是能夠滾動到我的div和X顯示,然後我可以添加我想要的效果。Mouseenter Hover Div顯示/隱藏
我使用JavaScript,因爲我需要它跨瀏覽器兼容。我不想使用CSS,因爲它在未來我想添加的內容非常有限。
<script>
$(document).ready(function() {
$('div.userinfo').hover({
mouseenter: function() {
$(this).children('div.delete').show();
},
mouseleave: function() {
$(this).children('div.delete').hide();
}
});
});
</script>
<?
echo "<div class='userinfo'><div class='delete' style='cursor:pointer;position:relative;top:0px;float:right;padding-right:5px;' onclick=\"delete_('".$streamitem_data['streamitem_id']."');\">X</div></div>"
它已經奏效。非常感謝。將接受作爲答覆和upvote。 – dave 2012-08-09 10:51:57
我很高興,我可以幫忙。 – 2012-08-09 11:31:39