<style>.entered{font-size:36px;width:200px;height:100px;}#test{border:2px solid red;background:#fdd;width:60px;height:60px;}</style></head><body>
<div id="test">移進(jìn)來</div>
<script>
$("#test").bind("mouseenter mouseout",function(event){
$(this).toggleClass("entered");
alert("鼠標(biāo)指針位于(" + event.pageX + "," + event.pageY + ")");
});
</script>上面這個(gè)簡單的jquery,issu1.entered{font-size:36px;width:200px;height:100px;}font-size:36px;起作用了 ,為何width:200px;height:100px; 沒有起作用?issue2$(this).toggleClass("entered");為何在alert("鼠標(biāo)指針位于(" + event.pageX + "," + event.pageY + ")");的后面運(yùn)行?如何讓 $(this).toggleClass("entered"); 運(yùn)行完成后,執(zhí)行alert?
為何運(yùn)行次序不按照程序運(yùn)行?
泛舟湖上清波郎朗
2018-09-02 11:16:28