Results 1 to 2 of 2

Thread: Show/hide on Certain Dates

  1. #1
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Show/hide on Certain Dates

    I'm looking for some kind of code to Show/hide based on dates.

    So, a div will show 9/01/09 though 10/01/09 and show another after that.

    Thanks

  2. #2
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default

    Hi,

    You could try something like:
    Code:
    <script type="text/javascript">
    <!--
    onload = function() {
    var today = new Date();
    var month = (( today.getMonth() ) + 1 );
    
    var date = today.getDate();
    
    var div = document.getElementById("divID");
    
       if ( month === 10 && date === 1 ) // Your preferred date settings.
          div.style.display = "block";
       else
          div.style.display = "none";
    };
    // -->
    </script>
    bring this up inside the header section of your page.

  3. The Following User Says Thank You to rainarts For This Useful Post:

    zbphill (09-22-2009)

Bookmarks

Posting Permissions

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