javascript - fadein fadeout jquery on mouse-over -


i have 3 sections default logo...left,middle , right..on mouse on sections changing 1 one own respective logo.

when mouse-over left section has changed logo problem when mouse-over logo on left section turned default section ( means left section vanished along logo)that don't want.

i need mouse effect off when mouse-over left section logo, same thing applicable on other 2 section..

the html :

<div id="container">     <div class="logo">         <img src="http://wphooper.com/svg/examples/circle_filled_with_pattern.svg">     </div>     <div class="main" id="left">         <div class="dot1-top">             <img src="http://www.subblue.com/assets/0000/2881/circle-guide_square.gif" width="53" height="52" alt="">         </div>         <div class="showhide">             <div class="main1 hide" style="background-image:url(http://bestwallpaperhd.com/wp-content/uploads/2012/12/vector-art-background.jpg)"></div>                     </div>     </div>     <div class="main"  id="middle">         <div class="dot2-top"><img src="http://www.subblue.com/assets/0000/2881/circle-guide_square.gif" width="53" height="52" alt=""></div>         <div class="showhide2">             <div class="main2 hide2" style="background-image:url(http://www.vectorfree.com/media/vectors/yellow-background-red-swirl.jpg)">             </div>                     </div>                </div>     <div class="main"  id="right">         <div class="dot3-top"><img src="http://www.subblue.com/assets/0000/2881/circle-guide_square.gif" width="53" height="52" alt=""></div>         <div class="showhide3">             <div class="main3 hide3" style="background-image:url(http://hdwallpaper2013.com/wp-content/uploads/2012/12/windows-7-background-hd-wallpaper-1080x675.jpg)">             </div>          </div>          </div> </div> 

and here's jsfiddle

i'm not sure if need did little cleanup markup , css , came solution hover effects

$('.bg').hide(); $('.main').hover(function (){     $(this).siblings('.main').find('.bg').stop().fadeout();     $(this).find('.bg').stop().fadein();     $('#logo img').attr('src',$(this).data('logo')); }, function () {}); $('#container').mouseleave(function(){     $('#logo img').attr('src',$(this).data('logo'));     $('.main .bg').stop().fadeout(); }); 

you can check updated fiddle here


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -