jQuery Mouseover

Mouseover these: Blog | Podcast

// include jquery.js library

// code inside this will happen after page is loaded
$(document).ready(function(){
	
	// find link where "href" attribute contains "podturtle", then bind a function to its mouseover event
	$('a[href*=podturtle]').bind('mouseover',function () { $('#target').text('You are mousing over the Podcast link.'); });
	
	// find link where "href" attribute contains "vanturtle", then bind a function to its mouseover event
	$('a[href*=vanturtle]').bind('mouseover',function () { $('#target').text('You are mousing over the Blog link.'); });
	
	/*
		see also:
			mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave
			click, dblclick
			blur, focus
			load, unload
			resize, scroll
			change, select, submit
			keydown, keypress, keyup
			error
		
		alternative approach (instead of "bind"):
			$('a[href*=vanturtle]').mouseover(function () { $('#target').text('You are mousing over the Blog link.'); });
	*/
});

© 2010 David Van Vickle. All rights reserved.