Bug Tracker

Ticket #3498: mouseenter.diff

File mouseenter.diff, 827 bytes (added by phiggins, 14 years ago)

shorten hover, add optional second param, add mouseenter/leave methods

  • event.js

     
    467467        },
    468468
    469469        hover: function(fnOver, fnOut) {
    470                 return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut);
     470                return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
    471471        },
    472472
    473473        ready: function(fn) {
     
    578578}
    579579
    580580jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
    581         "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
    582         "submit,keydown,keypress,keyup,error").split(","), function(i, name){
     581        "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
     582        "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){
    583583
    584584        // Handle event binding
    585585        jQuery.fn[name] = function(fn){