Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery hide() div until fully loaded
    primarykey
    data
    text
    <p>I'm using tabbed featured post for my blog. How to implement the <code>div#latest-featured</code> will <code>hide()</code> then <code>show()</code> it back after content fully loaded?</p> <pre><code>$(document).ready(function() { //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); }); </code></pre> <p>HTML</p> <pre><code>&lt;ul class="tabs"&gt; &lt;li&gt;&lt;a href="#f1"&gt;Title 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#f2"&gt;Title 2&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="latest-featured"&gt; &lt;div id="f1" class="tab_content"&gt; &lt;p&gt;Content for title 1&lt;/p&gt; &lt;p&gt;Why I want to hide the #latest-featured because.. when had image @ script here.. the tab_content will collapse all and break my design&lt;/p&gt; &lt;/div&gt; &lt;div id="f2" class="tab_content"&gt; &lt;p&gt;Content for title 1&lt;/p&gt; &lt;p&gt;Why I want to hide the #latest-featured because.. when had image @ script here.. the tab_content will collapse all and break my design&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Example I have a div with id <strong><code>#latest-featured</code></strong> and I want hide it until the content is fully loaded, and then show it back after everything is loaded.</p> <p>How to implement to the current code above.</p>
    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.
 

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