Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

jquery help

Featured Replies

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

$("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 :p

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.