前端中事件的运用

在原生中事件调用就需要加上on,例如:onmouseenter,onclick,

但是由于jquery自己封装了,不属于原生,所以我们在调用事件的时候不会用到on

$(document).ready(function(){
$(".parent").mouseenter(function(){
$(".child").animate({"width":"100%","height":"100%"},300);
});
$(".child").mouseleave(function(){
$(".child").animate({"width":"0%","height":"0%"},300);
});
});

posted @ 2016-10-26 11:32  爱笑的才  阅读(118)  评论(0编辑  收藏  举报