SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member azareale's Avatar
    Join Date
    Jan 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    day and night css

    If I have this

    Code:
     if (thehour <= 19)
      display = "default.css";
       else if (thehour >= 5)
      display = "daydefault.css";
     else
      display = "default.css";
    What do I need to change the numbers to in order to make default.css switch at 6 PM and last until 6 AM?

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Location
    Oskarshamn, Sweden
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Code:
    display = "default.css";
    if (thehour >= 6 && thehour < 18) {
    	display = "daydefault.css";
    }

  3. #3
    SitePoint Member azareale's Avatar
    Join Date
    Jan 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are wonderful!! Thank you so much!!!

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Location
    Oskarshamn, Sweden
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    No problem

  5. #5
    SitePoint Member azareale's Avatar
    Join Date
    Jan 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about this one?

    This is for an invisionfree forum and my other script doesn't work for this one...

    Code:
    <script language="javascript">
    /* script created by Chandler @ http://s4.invisionfree.com/digitalized <-- a great site for skins codes and support! */
    now = new Date();
    itime = now.getHours();
    function TSkinChange() {
    
    if (itime >= 19) {
    document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://hatchingyourdragons.com/daynocturne.css">');
    }
    if (itime <= 6) {
    document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://hatchingyourdragons.com/nightnocturne.css">');
    }}
    
    TSkinChange();
    </script>


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
  •