jqueryjquery-hoverjquery-1.9jquery-migrate

Use of hover throws up jquery-migrate error (jquery 1.9)


Continuation to the question -replacement for hover() in jquery1.9?

if .hover() should still work fine with 1.9, I am seeing the below error in console to replace hover with mouseenter, mouseleave.

Code and error screenshot below

  this.handle=this.handles.eq(0);

this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")}

enter image description here


Solution

  • .hover() is still supported, it's the pseudo-event that has been removed.

    For example

    .bind( "hover", function() {})
    

    should be replaced by

    .bind( "mouseenter mouseleave", function() {})
    

    ref: http://jquery.com/upgrade-guide/1.9/#quot-hover-quot-pseudo-event