From c5cd0c5a0a2046b4649b37145308840487e149a2 Mon Sep 17 00:00:00 2001 From: jk Date: Fri, 8 Jan 2016 09:16:25 +0100 Subject: [PATCH] fix hash problem with full url href hash Error: Syntax error, unrecognized expression: ttp://www.example.com/#panel1 http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js Line 2 --- js/foundation.tabs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/foundation.tabs.js b/js/foundation.tabs.js index fc2409c5a..72df19562 100644 --- a/js/foundation.tabs.js +++ b/js/foundation.tabs.js @@ -88,7 +88,7 @@ var $elem = $(this), $link = $elem.find('a'), isActive = $elem.hasClass('is-active'), - hash = $link.attr('href').slice(1), + hash = $link[0].hash.slice(1), linkId = hash + '-label', $tabContent = $(hash); @@ -209,12 +209,12 @@ */ Tabs.prototype._handleTabChange = function($target){ var $tabLink = $target.find('[role="tab"]'), - hash = $tabLink.attr('href'), + hash = $tabLink[0].hash, $targetContent = $(hash), $oldTab = this.$element.find('.' + this.options.linkClass + '.is-active') .removeClass('is-active').find('[role="tab"]') - .attr({'aria-selected': 'false'}).attr('href'); + .attr({'aria-selected': 'false'}); $($oldTab).removeClass('is-active').attr({'aria-hidden': 'true'}); -- 2.47.2