April 6, 201214 yr 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!
April 8, 201214 yr 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
April 8, 201214 yr 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 April 8, 201214 yr by brightonmike
April 8, 201214 yr 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!
April 8, 201214 yr Ah, well if IE support isn't an issue then 100% on CSS3! There should be crap loads of tutorials about.
Create an account or sign in to comment