June 15, 201016 yr Hey everyone. I have this bit of jquery code that makes a div appear when a link is clicked. $("div#colour_holder").css('display', 'block'); However I was wondering if it's possible to set a time for when it display so for example it displays 2 seconds after the link is clicked. Also I just want it to appear with no fade effects or anything. Thanks
June 15, 201016 yr $("div#colour_holder").animate({opacity:0}, 2000, function(){$(this).css('display', 'block')}); Should work. Basically we run an animation for two seconds which changes the opacity to 0 (it's already 0 so this just does nothing for 2 seconds). Then when the animation has complete we run the callback to reveal the div. Make sense? Not tested the code, normally i make small syntax errors when writing, if it doesn't work, check for missing quotes, semi colons or brackets
Create an account or sign in to comment