Note that there are some explanatory texts on larger screens.

plurals
  1. POHide both div and javascript code on mobile device
    primarykey
    data
    text
    <p>I Have two Divs apart from my content in my Bootstrap Layout</p> <p><strong>a) Social networking bar div</strong></p> <pre><code>&lt;div id="socialnetwork" class="navbar-text navbar-right visible-md visible-lg"&gt; &lt;span class='st_googleplus_large' displayText='Google +'&gt;&lt;/span&gt; &lt;span class='st_plusone_large' displayText='Google +1'&gt;&lt;/span&gt; &lt;span class='st_facebook_large' displayText='Facebook'&gt;&lt;/span&gt; &lt;span class='st_fblike_large fblike-align' displayText='Facebook Like'&gt;&lt;/span&gt; &lt;span class='st_twitter_large' displayText='Tweet'&gt;&lt;/span&gt; &lt;span class='st_email_large' displayText='Email'&gt;&lt;/span&gt; &lt;/div&gt; </code></pre> <p><strong>Associated JS Embed Tag</strong></p> <pre><code>&lt;script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; stLight.options( {publisher: "f1325bca-f8fc-4cec-9e01-02cd5ddd29ed", doNotHash: false, doNotCopy: false, hashAddressBar: false} ); &lt;/script&gt; </code></pre> <p><strong>b) Disqus Comments Div</strong></p> <pre><code>&lt;div id="disqus_thread" class="col-lg-10 visible-md visible-lg"&gt;&lt;/div&gt; </code></pre> <p>Screenshot Example - <a href="http://tinypics.in/image/o" rel="nofollow">http://tinypics.in/image/o</a> Jsfiddle code Example - <a href="http://jsfiddle.net/betacoder/buC6c/" rel="nofollow">http://jsfiddle.net/betacoder/buC6c/</a></p> <blockquote> <p><strong>My Aim is to ONLY LOAD this DIV along with there associated JAVASCRIPT if the viewport is for midscreen or largescreen and not on mobile / tablet layout (tohide if mobile/tablet)</strong></p> </blockquote> <p>Well the "<em>visible-md visible-lg</em>" tags lets me to hide the divs in mobile and tablet layouts.</p> <p><strong>But still the javascript is loading in the background and consuming the user bandwith.</strong></p> <blockquote> <p><strong>How to resolve this , would like to load the JS files associated with them only when Bootstrap layout on medium and large screen or on devices above 990px width.</strong></p> </blockquote> <p>Any Quickfix ? Love to hear the response or a near workaround.</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