简体   繁体   English

jquery ui sortable - 没有悬停事件

[英]jquery ui sortable - there is no hover event

I'm trying to get hold of hovered sortable element li 我正试图抓住悬停的可排序元素li

But it simply doesn't fire! 但它根本不会开火!

$("#sortable li").on("hover", function(){
    alert("yeeiii");
});

http://jsfiddle.net/adP6G/1/ http://jsfiddle.net/adP6G/1/

You are using jQuery 1.6 where .on() is not available.... also you are using sortable which requires jQuery ui library 你正在使用jQuery 1.6,其中.on()不可用....你也在使用需要jQuery ui库的sortable

Also hover is not an event, it is a method 还有悬停不是事件,它是一种方法

$("#sortable li").hover(function(){
    alert("yeeiii");
});

Demo: jQuery 1.7 演示: jQuery 1.7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM