Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery UI tabs, Linking between tabs externally only goes to tab one regardless of which tab anchor is in the url
    primarykey
    data
    text
    <p>I am trying to link to specific tabs externally. With the script I am using no matter which tab anchor is in the url it always goes to tab 1 when I use Google Analytics tagging in the url it only goes to tab one even though my script tells it to ignore everything after the parameter. I am linking to tabs using the following url - <a href="http://www.mysite.com/myshorturl#tabs-6?utm_source=campaign_detail&amp;utm_medium=email&amp;utm_campaign=my_campaign" rel="nofollow">http://www.mysite.com/myshorturl#tabs-6?utm_source=campaign_detail&amp;utm_medium=email&amp;utm_campaign=my_campaign</a></p> <p>I need it to ignore the parameter and everything after it and link to the correct tab. The scripts work as expected when not using GA tagging:</p> <p><strong>HTML:</strong></p> <pre><code>&lt;div id="tabs"&gt; &lt;ul id="tab-ul"&gt; &lt;li class="class1"&gt;&lt;a class="scroll" id="tab-1" href="#tabs-1"&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="class2"&gt;&lt;a class="scroll" id="tab-2" href="#tabs-2"&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="class3"&gt;&lt;a class="scroll" id="tab-3" href="#tabs-3"&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="class4"&gt;&lt;a class="scroll" id="tab-4" href="#tabs-4"&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="class5"&gt;&lt;a class="scroll" id="tab-5" href="#tabs-5"&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="class6"&gt;&lt;a class="scroll" id="tab-6" href="#tabs-6"&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="tabs-1"&gt;&lt;/div&gt; &lt;div id="tabs-2"&gt;&lt;/div&gt; &lt;div id="tabs-3"&gt;&lt;/div&gt; &lt;div id="tabs-4"&gt;&lt;/div&gt; &lt;div id="tabs-5"&gt;&lt;/div&gt; &lt;div id="tabs-6"&gt;&lt;/div&gt; </code></pre> <p><strong>JQUERY:</strong></p> <pre><code>$(function () { // run the jquery ui plugin $('#tabs').tabs(); $("#tabs").tabs({ select: function(event, ui) { window.location.hash = ui.tab.hash; } }); }); $(window).bind("load", function () { var CleanURL = window.location.href.split("?")[1]; var urlHash = CleanURL.split("#")[1]; $('html,body').animate({ scrollTop: $('a[href="#' + urlHash + '"]').offset().top -40}, 300); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload