View Single Post
Old 02-18-2013, 11:39 AM   PM User | #10
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Almost.
The basic syntax looks like this:
Code:
$('#tag-hover').mouseenter(mouseInFunction).mouseleave(mouseOutFunction);
And your code specifically would look like this then:
Code:
$('#tag-hover')
	.mouseenter(
		function(){
    			$('div.tag-font').stop(true, true).fadeOut(100, function(){
    				$('div.tag-image').stop(true, true).fadeIn(400);
    			});
    		}
	)
	.mouseleave(
		function() {
    			$('div.tag-image').fadeOut(400, function(){
    				$('div.tag-font').fadeIn(100);						 
    			});
    		}
    	);
This is a very verbose way of writing it, it could as well look like this:
Code:
$('#tag-hover')
	.mouseenter(function(){
    		$('div.tag-font').stop(true, true).fadeOut(100, function(){
    			$('div.tag-image').stop(true, true).fadeIn(400);
    		});
    	})
	.mouseleave(function() {
    		$('div.tag-image').fadeOut(400, function(){
    			$('div.tag-font').fadeIn(100);						 
    		});
    	});
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote