Thread: Javascript desplay link after x seconds

Results 1 to 4 of 4
  1. #1 Javascript desplay link after x seconds 
    Registered Member Icedice's Avatar
    Join Date
    Mar 2010
    Posts
    88
    Thanks given
    2
    Thanks received
    5
    Rep Power
    0
    I'm trying to hide a link for about 4 minutes until the viewer is done watching a video. Problem is I cant seem to get the link to hide. I've tried it multiple ways but none seem to work, here's what I currently got:

    Code:
    <div id="welcome">
    <video width="480px" height="320px" controls="controls" preload="auto">
    <source src="intro.mp4" type="video/mp4" />
    Your browsers does not support this element. Please upgrade to google-chrome!
    </video>
    <br />
    <br />
    <script type ="text/javascript">
    setTimeout(document.write("<a href="#">Continue</a>"), 400000);
    </script>
    </div>
    Unfortunately that doesn't work and I have ran out of ideas...
    Any help would be appreciated!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Ant-Man's Avatar
    Join Date
    Aug 2010
    Posts
    1,018
    Thanks given
    277
    Thanks received
    177
    Rep Power
    452
    Code:
    <div id="welcome">
    <video width="480px" height="320px" controls="controls" preload="auto">
    <source src="intro.mp4" type="video/mp4" />
    Your browsers does not support this element. Please upgrade to google-chrome!
    </video>
    <br />
    <br />
    <a href="#" id="continue" style="display:none;">Continue</a>
    <script type ="text/javascript">
    function show(id){
    document.getElementById(id).style.display='block';
    }
    setTimeout("show('continue')",4000);
    </script>
    </div>

    There's probably a really better way of doing it, but it gets the job done.

    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member Icedice's Avatar
    Join Date
    Mar 2010
    Posts
    88
    Thanks given
    2
    Thanks received
    5
    Rep Power
    0
    Quote Originally Posted by Ant-Man View Post
    Code:
    <div id="welcome">
    <video width="480px" height="320px" controls="controls" preload="auto">
    <source src="intro.mp4" type="video/mp4" />
    Your browsers does not support this element. Please upgrade to google-chrome!
    </video>
    <br />
    <br />
    <a href="#" id="continue" style="display:none;">Continue</a>
    <script type ="text/javascript">
    function show(id){
    document.getElementById(id).style.display='block';
    }
    setTimeout("show('continue')",4000);
    </script>
    </div>

    There's probably a really better way of doing it, but it gets the job done.
    It worked thank you!
    Reply With Quote  
     

  5. #4  
    Registered Member
    Anthony`'s Avatar
    Join Date
    Sep 2008
    Age
    29
    Posts
    763
    Thanks given
    75
    Thanks received
    164
    Rep Power
    204
    Quote Originally Posted by Ant-Man View Post
    Code:
    <div id="welcome">
    <video width="480px" height="320px" controls="controls" preload="auto">
    <source src="intro.mp4" type="video/mp4" />
    Your browsers does not support this element. Please upgrade to google-chrome!
    </video>
    <br />
    <br />
    <a href="#" id="continue" style="display:none;">Continue</a>
    <script type ="text/javascript">
    function show(id){
    document.getElementById(id).style.display='block';
    }
    setTimeout("show('continue')",4000);
    </script>
    </div>

    There's probably a really better way of doing it, but it gets the job done.
    That should do fine actually.
    PS: The first parameter for setTimeout can also be an anonymous function (which is faster!), just sayin.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Minute to seconds and a seconds to minute method
    By Dark Regen in forum Configuration
    Replies: 11
    Last Post: 04-20-2010, 10:47 PM
  2. Replies: 22
    Last Post: 11-21-2009, 08:38 PM
  3. Replies: 6
    Last Post: 09-12-2009, 12:07 AM
  4. tut link to portforward with d-link
    By Zomaian in forum RS2 Server
    Replies: 0
    Last Post: 06-22-2008, 09:43 PM
Tags for this Thread

View Tag Cloud

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