From d3307751c07be28637d39a1573103b600f5e1be5 Mon Sep 17 00:00:00 2001 From: Christophe H Date: Wed, 8 Jun 2016 15:48:18 +0200 Subject: [PATCH] Prevent the default action on controls If you have a as controls (), it will jump to the anchor on click. To avoid that, the solution is to add a preventDefault to the event on the controls click. --- jquery.tabslet.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jquery.tabslet.js b/jquery.tabslet.js index 072336e..27e46bb 100644 --- a/jquery.tabslet.js +++ b/jquery.tabslet.js @@ -203,12 +203,14 @@ } - $this.find(options.controls.next).click(function() { + $this.find(options.controls.next).click(function(e) { move('forward'); + e.preventDefault(); }); - $this.find(options.controls.prev).click(function() { + $this.find(options.controls.prev).click(function(e) { move('backward'); + e.preventDefault(); }); $this.on ('show', function(e, tab) { @@ -242,4 +244,4 @@ $(document).ready(function () { $('[data-toggle="tabslet"]').tabslet(); }); -})(jQuery); \ No newline at end of file +})(jQuery);