]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
some fixes
authorAndy Hebrank <ahebrank@gmail.com>
Sat, 8 Oct 2016 16:12:43 +0000 (12:12 -0400)
committerAndy Hebrank <ahebrank@gmail.com>
Sat, 8 Oct 2016 16:12:43 +0000 (12:12 -0400)
js/foundation.tabs.js

index 01a510b05856e7b63a2aa753ecf8daa9d8d2e4c5..5971f95a7c53bf2bec1064905424f57eeb8cb1cf 100644 (file)
@@ -75,13 +75,13 @@ class Tabs {
       //use browser to open a tab, if it exists in this tabset
       if (_this.options.deepLink) {
         var anchor = window.location.hash;
-        //need a has and a relevant anchor in this tabset
-        if (anchor.length && this.$tabTitles.find('[href="'+anchor+'"]').length) {
-          this.selectTab($(anchor));
+        //need a hash and a relevant anchor in this tabset
+        if (anchor.length && $elem.find('[href="'+anchor+'"]').length) {
+          _this.selectTab($(anchor));
           //roll up a little to show the titles
           if (_this.options.deepLinkSmudge) {
-            var offset = this.$tabTitles.offset();
             $(window).load(function() {
+              var offset = $elem.offset();
               $('html, body').animate({ scrollTop: offset.top }, _this.options.deepLinkSmudgeDelay);
             });
           }