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 link hover fade

Featured Replies

Hi,

 

Just trying to throw together a portfolio in a bit of a rush(!), and I just would like a nice quick fade on the link background, and a fadeout when you mouseout from them.

 

Please see here.

 

If you rollover the links, you get a nice fade, but when you mouse-out, the whole link disappears! Would someone be able to have a quick look and let me know how I can make the link fade back to its original state?

 

<script>
$(document).ready(function(){
	$("#nav a").hover(function(){
		$(this).stop().fadeTo(500,1);
	},
	function(){
		$(this).stop().fadeTo(500,0);
	});
});
</script>

 

I've had a look around the net, and other tutorials/sites show similar fades, but I couldn't find anything that would help me with my site.

 

Help much appreciated!

  • Author

Use CSS3 instead.

 

Care to elaborate a bit? I am using css to create the gradients, inner shadow and rounded corners. I just need to know the best way to do the rollover and rollout using jquery

I just wouldn't bother using jQuery for a transition. I use CSS3 transitions instead.

 

Sure, there's no IE support at the moment, but I don't think that matters too much, and will change with IE10. I don't think anybody bothers using jQuery for this sort of thing anymore.

Edited by brightonmike

  • Author

I just wouldn't bother using jQuery for a transition. I use CSS3 transitions instead.

 

Sure, there's no IE support at the moment, but I don't think that matters too much, and will change with IE10. I don't think anybody bothers using jQuery for this sort of thing anymore.

 

Ah ok, will look into css transitions a bit more - thanks. Not bothered about ie support at this stage, i'll sort that later! Cant wait for ie10!

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.