Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iMasterWeb

macrumors regular
Original poster
Mar 15, 2009
158
0
Hi! I'm trying to simply make a jQuery script that, on rollover, fades an image from 50% opacity to 100% and then back to 50% when you stop hovering. The image(s) (there are 2 right now, both of class ".postImage") are inside of <a> tags, if it matters. Here's my code:
Code:
$(document).ready(function() {
	$(".postImage").fadeTo("fast", 0.5);
	
	
	$(".postImage").hover(
	function() {
		$(this).fadeTo("normal", 1.0);
	},	
	function(){
		$(this).fadeTo("normal", 0.5);
		});
});

Thanks for the help!

EDIT: Hmm..... It seems to be working now, I just deleted the line in my HTML that linked to the jQuery, and then put it back. Weird....
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.