onclick - jquery on click event working on all divs with same class -
i having few issues jquery click event , need help.
i have image plus sign. once user clicks plus sign want background text div fade in. text div has cross. when user clicks cross text div fades out , image fades in. if me?
there few of these boxes on page , issue code triggers fade action on divs. not once click on.
here html. there multiple of these on page create portfolio block.
<a class="flip-container"> <div class="flip-container"> <div class="flipper"> <div class="front"> <div class="plus"></div> <img src="img/portfolio.jpg" alt="animation"> <h3>project name</h3> </div> <div class="back"> <div class="cross"></div> <p>some text goes here.</p> <p>by persons name</p> </div> </div> </div>
here jquery:
$('.back').hide(); $('.flip-container .plus').click(function(e){ $('.front').fadeout('slow', function(){ $('.back').fadein('slow'); }); }); $('.flip-container .cross').click(function(e){ $('.back').fadeout('slow', function(){ $('.front').fadein('slow'); }); });
don't use div class give div want happen on id , change jquery match it.
Comments
Post a Comment