Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>GREAT! I got it down to 3 lines! Thanks @Bryan Denny and @GeReV!</p> <p>JS/jQuery Code:</p> <pre><code> // Count the number of tabs var countTabs = $('.tab_randomiza').children().size(); // Find a random number between 0 and the number of tabs (countTabs) var randomizeIt = Math.floor(Math.random()*(countTabs)); // Tell the tabs which one to be active $('#randomiza_wrapper').tabs({ selected: randomizeIt }); </code></pre> <p>HTML: </p> <pre><code> &lt;div class="titlebar titlebar_secondary"&gt; &lt;h3&gt;Test Bucket&lt;/h3&gt; &lt;/div&gt;&lt;!-- end .titlebar_secondary --&gt; &lt;div id="randomiza_wrapper"&gt; &lt;ul class="tab_header tab_randomiza"&gt; &lt;li class="randomiza-tab1 ui-tabs-selected"&gt;&lt;a href="#one"&gt;one&lt;/a&gt;&lt;/li&gt; &lt;li class="randomiza-tab2"&gt;&lt;a href="#two"&gt;two&lt;/a&gt;&lt;/li&gt; &lt;li class="randomiza-tab3"&gt;&lt;a href="#three"&gt;three&lt;/a&gt;&lt;/li&gt; &lt;li class="randomiza-tab4"&gt;&lt;a href="#four"&gt;four&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="one" class="bucket_secondary randomiza_bucket1"&gt; &lt;ul class="story_list sidebar_story_list"&gt; &lt;li&gt; Content One &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- end #one --&gt; &lt;div id="two" class="bucket_secondary preventFOUC randomiza_bucket2"&gt; &lt;ul class="story_list sidebar_story_list "&gt; &lt;li&gt; Content Two &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- end #two --&gt; &lt;div id="three" class="bucket_secondary preventFOUC randomiza_bucket3"&gt; &lt;ul class="story_list sidebar_story_list "&gt; &lt;li&gt; Content Three &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- end #three --&gt; &lt;div id="four" class="bucket_secondary preventFOUC randomiza_bucket4"&gt; &lt;ul class="story_list sidebar_story_list "&gt; &lt;li&gt; Content Four &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- end #four --&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- end #top_jobs --&gt; </code></pre>
 

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