Jquery hover lock up
This imageswitch fade animation locks up sometimes when mousing out and leaves the 'facebookblue.png' in place until the next mouseover?
$("#facebookrollover").hover(function(){
$("#facebookimg").stop(true, true).ImageSwitch({NewImage:"facebookblue.png", Speed:200});
},
function(){
$("#facebookimg").stop(true,开发者_如何学运维 true).ImageSwitch({NewImage:"facebookgrey.png", Speed:400});
});
And the html part:
<a id="facebookrollover" href="http://www.facebook.com"><img id="facebookimg" src="facebookgrey.png" alt="Facebook" /></a>
Oh and I'm using the imageswitch jquery plugin, but I doubt that that is the problem, since I get same problem when just changing the opacity.
You could do this with only css: place two img
tags inside a
one hidden by default, and switch therir display
property on :hover
. Or even better combine them in sprite and just change background-position.
精彩评论