javascript - Automatic Bootstrap Tabs -
i want bootstrap tabs automatically tab when tab clicked want tabbing pause amount of time or stop completely. here piece of javascript using.
var timer = null, interval = 1000, value = 0; $("#start").click(function() { if (timer !== null) return; timer = setinterval(function () { value = value+1; $("#input").val(value); }, interval); }); $("#stop").click(function() { clearinterval(timer); timer = null });
if have not solved ... here fiddle can check.
// tab click event handler $('a').on('click', function (e) { e.preventdefault(); // stop cycle clearinterval(tabcycle); // show clicked tabs associated tab-pane $(this).tab('show'); // start cycle again in predefined amount of time settimeout(function () { //tabcycle = setinterval(tabchange, 5000); }, 15000); });
Comments
Post a Comment