我预想的是让 灰色-绿色 这个范围有事件,
怎么弄出来后,实际情况是 绿色-蓝色 有事件?
<div class="gray" id="gray"> <div class="red jz" id="red"> <div class="green jz" id="green"> <div class="yellow jz" id="yellow"> <div class="blue jz" id="blue"> </div> </div> </div> </div> </div>
我的理解是,语法是这样 $("冒泡父起始选择器").on("事件","冒泡子结尾选择器",'Function参数',FunctionName); 我是这样写的: $("#gray").on("click","#green",'我是事件啊,次数是',info); var a = 0; function info(e) { a = a + 1; str = e.data + ':' + a ; $("span").text(str); }
神不在的星期二
相关分类