且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用.on()事件的变量,自定义jQuery插件中的侦听器不会触发

更新时间:2022-12-11 14:45:22

.on('hover', function).hover(function, function)不同-它不接受两个函数.删除第二个事件,然后触发事件.

.on('hover', function) is not like .hover(function, function) - it doesn't accept two functions. Remove the second one and the events trigger.

http://jsfiddle.net/U78RV/4/

您仍然可以创建这两个事件

You can still create those two events

$("#firstBox").randomLetterStyles({type: 'mouseover', ...}).randomLetterStyles({type: 'mouseout', ...});