jquery - Fade In/Out Background Image with Another Image / fade out other elements -


i'm having trouble fadein/out of elements. need have several divs, fade in new background, text when hovered over. need have other divs fade out some, while i'm hovered on element.

i can fade out other elements if i'm hovered on element, rest of problem cannot figure out.

i want specific divs affected have other divs (id , classes) on page.

here fiddle: http://jsfiddle.net/deelite/snvmr/2/

my jquery:

$('div').hover(function() {   $('div').not($(this)).stop().fadeto(500, 0.33);   }, function() {   $('div').stop().fadeto(500, 1); }); 

i'm not sure how else proceed.

just use .not(this); .not($(this)) incorrect. had couple other errors. can add class (e.g., .effect) the divs want apply effect to.

html:

<div class="effect one"><p>me</p></div> <div class="effect two"><p>have</p></div> <div class="effect three"><p>fun</p></div> 

jquery:

$('.effect').hover(     function() {         $('.effect').not($(this)).stop().fadeto(500, 0.33);     }, function() {         $('.effect').stop().fadeto(500, 1);     } ); 

fiddle: http://jsfiddle.net/snvmr/5/


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -