Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    disable DIV on load

    Hello,

    I have been looking for a good walk-through online, but can't seem to find an exact resolution to what I am trying to do.

    Can someone please supply some example code for not displaying everything that is inside a <div>. Basically I do not want social media content to be displayed on secure pages, but want them on every other page. This is what I have:
    Code:
    <div id="share">
    	<ul>
    		<li>
    			<div class="addthis_toolbox addthis_default_style ">
    				<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=###### class="addthis_button_compact">Share</a>
    					<span class="addthis_separator">|</span>
    				<a class="addthis_button_preferred_1"></a>
    				<a class="addthis_button_preferred_2"></a>
    				<a class="addthis_button_preferred_3"></a>
    				<a class="addthis_button_preferred_4"></a>
    			</div>
    		</li>	
    		<script>
    			var addthis_config = {"data_track_clickback":true};
    			if (document.location.protocol !== 'https:') {
    				$jq.getScript('http://s7.addthis.com/js/250/addthis_widget.js?username=######', function() { });
    			}
    		</script>
    	</ul>
    </div>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,314
    Thanks
    203
    Thanked 2,565 Times in 2,543 Posts
    <div id = "mydiv" style="display:none">Content of the div</div>

    and then to show the div in script

    document.getElementById("mydiv").style.display="block";


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •