rwAddLink jQuery plugin

Send Snippet To: Save this snippet to Code Collector Pro -- view all seydoggy's snippets
language: JavaScript
license: Other

Code for Snippet:

                
/*
	# rwAddLinks (jQuery plugin) #
 
	AUTHOR:	Adam Merrifield <http://adam.merrifield.ca>
	VERSION: v1.0.0
	DATE: 06-17-11 07:54
 
	USAGE:
	- include this plugin code along with jQuery
	- include an array of URL's with as many items as
		there are elements to link
	- select a group of elements to link
	- invoke .rwAddLinks()
 
	EXAMPLE:
		var someLinks = [
			"http://www.google.com",
			"http://www.twitter.com",
			"http://www.facebook.com"
		];
		$('.someDiv').rwAddLinks(someLinks);
*/
(function($) { $.fn.rwAddLinks = function(linkArr) { var i = 0; $(this).each(function(i) { $(this).click(function() { location.href = linkArr[i++]; }).hover(function() { $(this).css("cursor", "pointer"); }); }); }; })(jQuery);
comments powered by Disqus

Info

Tags: rwAddLinks rapidweaver jQuery plugin links

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 1078
Date Added: 2011-06-17 14:46:18
Last Modified: 0000-00-00 00:00:00

Web Analytics