diff --git a/README.md b/README.md index 0c9adbf..1386631 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ $(function() { |------|-------|-----------| | selectorAttribute | false | Override the default `href` attribute used as selector when you need to activate multiple TabPanels at once with a single Tab using the `data-target` attribute. | | backToTop |false | Prevent the page from jumping down to the tab content by setting the backToTop setting to true. | +| showTabUsingClickTrigger |false | Activate the requeted tab using the click trigger so that any behaviours on the click trigger are activated. | NuGet package ============= diff --git a/bower.json b/bower.json index 2e5e3c9..b9e3b27 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jquery-stickytabs", - "version": "1.2.3", + "version": "1.2.5", "homepage": "https://github.com/aidanlister/jquery-stickytabs", "authors": [ "Aidan Lister " diff --git a/jquery.stickytabs.js b/jquery.stickytabs.js index a1a653e..e0f1b27 100644 --- a/jquery.stickytabs.js +++ b/jquery.stickytabs.js @@ -11,6 +11,7 @@ var settings = $.extend({ getHashCallback: function(hash, btn) { return hash }, selectorAttribute: "href", + showTabUsingClickTrigger: false, backToTop: false, initialTab: $('li.active > a', context) }, options ); @@ -20,7 +21,11 @@ var hash = settings.selectorAttribute == "href" ? window.location.hash : window.location.hash.substring(1); if (hash != '') { var selector = hash ? 'a[' + settings.selectorAttribute +'="' + hash + '"]' : settings.initialTab; - $(selector, context).tab('show'); + if (settings.showTabUsingClickTrigger === true) { + $(selector, context).trigger('click'); + } else { + $(selector, context).tab('show'); + } setTimeout(backToTop, 1); } } diff --git a/package.json b/package.json index dac6ebd..315c3da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jquery-stickytabs", - "version": "1.2.3", + "version": "1.2.5", "description": "jquery-stickytabs =================", "main": "jquery.stickytabs.js", "directories": {