www.webdeveloper.com
Results 1 to 5 of 5

Thread: Gateway for a kid on the net

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Location
    Jackson MS
    Posts
    374

    Question Gateway for a kid on the net

    Right now my grandson has a folder of his favorite sites (we set them up, the child is < 5yo) on IE. We are thinking of giving him his own home page with links to those sites which would become disabled at a certain time on school nights. While I know how to get the time of day and day of week, I would like to be able to easily override this for things like holidays.

    Any suggestions on how this could be done? TIA

  2. #2
    Join Date
    Dec 2007
    Location
    Dayton, OH
    Posts
    390
    Quote Originally Posted by wbport View Post
    Right now my grandson has a folder of his favorite sites (we set them up, the child is < 5yo) on IE. We are thinking of giving him his own home page with links to those sites which would become disabled at a certain time on school nights. While I know how to get the time of day and day of week, I would like to be able to easily override this for things like holidays.

    Any suggestions on how this could be done? TIA
    Find the date and time.

    http://www.w3schools.com/jS/js_obj_date.asp
    http://www.w3schools.com/jsref/tryit...yjsref_gettime

    Have a hidden div on your page with a list of the links.
    Code:
    <div id="links" style="display:none;"> blah blah blah</div>
    If the date and time is within a valid range display the div with the links in it.

    Code:
    document.getElementById("links").style.display = 'inline';

  3. #3
    Join Date
    Sep 2009
    Posts
    2
    Enclose all the links in a container DIV and give it an id something like below
    Code:
    <div id="linkList">
      <a href="somelink"> somelink</a>
      <a href="somelink"> somelink</a>
    </div>
    Have an array which will contain only hours and minutes for which you want the links to be disabled. Using the 'for' loop go through the list at on load of the page. If the current hour and minute matches the one in the list then using 'getElementById' function hide the div as below.
    Code:
    document.getElementById('linkList').style.display='none';
    Before hiding, have one more array containing list of holidays on which you dont want to hide these links. Compare the current date with this list and only if the current date doesnt fall in the list, go ahead and hide the links.

    Hope i have not confused you and I hope it helps...

  4. #4
    Join Date
    Sep 2008
    Location
    Jackson MS
    Posts
    374

    Resolved

    I thank both of you for your input--I'm sorry to say I hadn't thought of using <div>'s, but that seems to be the way to go. My prototype is name.htm, replace "name" or "Name" with the child's name, fix the date of birth, change password (optional), and either provide the picture or delete the code that asks for it.

    Instead of a table for holidays, I put in a password option (default is face).
    Last edited by wbport; 09-17-2009 at 03:31 PM. Reason: How to override.

  5. #5
    Join Date
    Sep 2008
    Location
    Jackson MS
    Posts
    374

    Resolved? Maybe not.

    The link in the a previous post works, but is there a way to start it without the yellow, "Goodnight Name" message appearing, even for an instant if curfew is not in effect?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles