https://github.com/springload/autoswitcher.js
Create tabbed content on the fly (requires jQuery)
https://github.com/springload/autoswitcher.js
jquery tabs
Last synced: 11 months ago
JSON representation
Create tabbed content on the fly (requires jQuery)
- Host: GitHub
- URL: https://github.com/springload/autoswitcher.js
- Owner: springload
- Created: 2014-10-31T00:07:21.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-17T23:15:33.000Z (about 11 years ago)
- Last Synced: 2025-02-01T06:25:41.499Z (about 1 year ago)
- Topics: jquery, tabs
- Language: JavaScript
- Size: 148 KB
- Stars: 0
- Watchers: 35
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#AutoSwitcher.js
===============
Create tabbed content on the fly (requires jQuery)
(Example: http://jsfiddle.net/Hitbox/vo35t6u2/1/)
##Howto:
```
$( document ).ready(function() {
var switcher = new AutoSwitcher();
switcher.function_a = function(trigger, collection) {
console.log("showing");
console.log(trigger);
console.log(collection);
}
switcher.function_b = function(trigger, collection) {
console.log("hiding");
console.log(trigger);
console.log(collection);
}
switcher.init({
".button1" : {
"showStart" : true,
"elements" : [
".showhide1",
"#showhide2"
],
"activeClass" : "active",
"onShowCall" : "function_a",
"onHideCall" : "function_b"
},
"#button2" : {
"elements" : [
".showhide3",
"#showhide4"
],
"activeClass" : "active",
"onShowCall" : "function_a"
},
"button" : {
"elements" : [
".showhide1",
"#showhide2",
".showhide5",
"#showhide6"
],
"activeClass" : "active"
}
});
});
```