前端中事件的运用

在原生中事件调用就需要加上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);
});
});

原文地址:https://www.cnblogs.com/huagnchucai/p/5999732.html