tags:

views:

15

answers:

2

Hi,

I have a problem on this code

$(document).ready(function(){
    $('.nm_close').click(function(){
        $('.map_pops').css('display','none');
    });
});

What I want is this bubble popup will fades out when it closes. Thank you!

+2  A: 

Have you tried fadeOut(250);?

so, $('.map_pops').fadeOut(250);

btw: 250 is the milliseconds it should take to fade out. So 5000 would be 5 seconds(ish).

griegs
Does the fadeOut automatically set the value to 'display:none' ?
Eron
it will hide the element yes.
griegs
Oh, and if there are elements under it, all the elements move up as expected.
griegs
Alright, you're right! Thank you griegs!
Eron
You are welcome. Don't forget to mark this as the correct answer for others that might be having the same issue.
griegs
A: 

You'll want to use the fadeOut() function (see: http://api.jquery.com/fadeOut/).

$(document).ready(function(){
    $('.nm_close').click(function(){
        $('.map_pops').fadeOut(<duration>);
    });
});

is the length of time you want it to fade out over be it slow, fast etc. Its all in the documentation of fadeOut()

Rosco