set a controller element and have it toggle multiple elements
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
README
jqToggle.js
jqToggle.min.js

README

Tested in jQuery versions: "1.4.3", "1.4.4", "1.5", "1.6.4", "1.7.0", "1.7.1"

Basically I am sick of re-writing the toggle on/off functionality again and again. I wrote this guy as a replacement for that.

Example:

HTML
	
		<div id="test2">
			<div id="toggle4">Toggle 4</div>
			<a id="controller2" href="#">Hide Toggles</a>
			<div id="toggle2">
				Toggle 2
			</div>
			<div id="toggle3">
				Toggle 3
			</div>
		</div>

Js
	
		
		$("#controller2").toggleControl({
			views: "#toggle2, #toggle3, #toggle4",
			hiddenText: "Show Toggles",
			visibleText: "Hide Toggles",
			preToggle: function(){
				//this will run before the toggles occur
			},
			postToggle: function(){
				//this will run after the toggles occur
			}
		});