i trying edit code website. right now, on hover activates overlay on image. want add in addition activating overlay changes background color of body. can done within code or more work think? thanks!
jquery('.images').hoverintent(function() { jquery(this).find('.title-wrap').stop().each(function() { jquery(this).animate({ width: jquery(this).data('wrapping') }, 150); });
one way configure hoverintent 2 functions arguments .... 1 each of mouseenter , mouseleave.
for body toggle class , set background in css rule
function hoverin(){ $('body').addclass('different-background-class'); jquery(this).find('.title-wrap').stop().each(function() { jquery(this).animate({ width: jquery(this).data('wrapping') }, 150); } function hoverout(){ $('body').removeclass('different-background-class'); jquery(this).find('.title-wrap').stop().width('auto'); } // pass 2 function references arguments jquery('.images').hoverintent(hoverin,hoverout); i'm not sure if have width defined prior animation. if can store initial value within hoverin() function in order reset in hoverout(). used auto assuming wasn't set in normal state
Comments
Post a Comment