Im new for jQuery and want to make it a little cleaner as well as add functionality, but not sure how to do it, so I was hoping someone could give me a hand.
tabs (working) for now
$(".tabs-menu a").click(function(event) {
event.preventDefault();
$(this).parent().addClass("active");
$(this).parent().siblings().removeClass("active");
var tab = $(this).attr("href");
$(".tab-content").not(tab).css("display", "none");
$(tab).show();
});
Currently it only works on the click event, but you want to add something so that I can add automatic tab changes, for example using
hokTabs.pause ();
etc. This is basically when you hover iutem, it will stop and start again when you hover a button.
Does anyone have any idea?
(function (hokTabs, $) {
var internal = '5000';
hokTabs.start = function () {
console.log('started');
}
hokTabs.stop = function () {
console.log('started');
}
hokTabs.pause = function () {
console.log('started');
}
}(window.hokTabs, jQuery));
James source
share