Thursday, February 27, 2014

  •    Random DIV Loaded
  • Place on <body> or Layout Page  (blogger support )

    <div class="item" >... your content here...</div>
    <div class="item" >... your content here...</div>
    <div class="item" >... your content here...</div>
    <div class="item" >... your content here...</div>

    <script type="text/javascript">
    var random = Math.floor(Math.random() * $('.item').length);
    $('.item').hide().eq(random).show();
    </script>


    Demo : Refresh this page will change the color of the div as an example on the right

    Wednesday, February 19, 2014

  •    How to Make DIV Appear & fade out at Certain Times in Accordance with The Time Specified
  • Copy code below and paste after <head>

    <script type="text/javascript">
    function showIt() {
    document.getElementById("hid").style.display = "block";
    }
    setTimeout("showIt()",12000);
    $(document).ready( function() {
            $('#hid').delay(1000).fadeOut();
          });

    </script>

    Place anywhere on  <body> or place on Layout Page ( add a gadget - html/javascript )

    <div id="hid" style="width:200px;height:200px;opacity:0.1;background-color:orange;text-align:center;display:none;">
    this is Loading & Fade Out DIV with timer
    </div>

    Note; always use the latest jquery
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js">
    </script>


    DEMO : wait a minute and it will show up div with orange background