Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Tabs - getting selected tab on page reload
    primarykey
    data
    text
    <p>I'm using the jQuery Tabs function from <a href="http://jqueryfordesigners.com/jquery-tabs/" rel="nofollow">jqueryfromdesigners</a>, but only the first example works for me. That's the script-code I use:</p> <pre><code> &lt;script type="text/javascript" charset="utf-8"&gt; $.noConflict(); $(function () { var tabContainers = $('div.tabs &gt; div'); tabContainers.hide().filter(':first').show(); $('div.tabs ul.tabNavigation a').click(function () { tabContainers.hide(); tabContainers.filter(this.hash).show(); $('div.tabs ul.tabNavigation a').removeClass('selected'); $(this).addClass('selected'); return false; }).filter(':first').click(); }); &lt;/script&gt; </code></pre> <p>And here's the demo-code for displaying the tabs:</p> <pre><code>&lt;div class="tabs"&gt; &lt;!-- tabs --&gt; &lt;ul class="tabNavigation"&gt; &lt;li&gt;&lt;a href="#first"&gt;Send a message&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#second"&gt;Share a file&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#third"&gt;Arrange a meetup&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!-- tab containers --&gt; &lt;div id="first"&gt; &lt;p&gt;Lorem ipsum dolor sit amet.&lt;/p&gt; &lt;/div&gt; &lt;div id="second"&gt; &lt;p&gt;Sed do eiusmod tempor incididunt.&lt;/p&gt; &lt;/div&gt; &lt;div id="third"&gt; &lt;p&gt;Ut enim ad minim veniam&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I have already changed the code for my use. In the tab-content-divs are now displayed informations which I grab via php. This content has many links in it that reloads the page when clicked. </p> <p>How can I achieve that when the user clicks on a link in #tab2 the page reloads and displays the last selected #tab2? Now it always shows #tab0...</p> <p>I would appreciate any hint on this!</p>
    singulars
    1. This table or related slice is empty.
    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.
    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