Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with image script variables

    I've written a webcam script for my website. I'm trying to improve it so that you can select the the amount of time until the next refresh. The "time" part seems to be giving me trouble in the code below:

    function pause(time) {
    document.images['cam'].onload = 'pause(time)';
    setTimeout('refresh()',time);
    }

    On 2nd line(starts document.images['cam']...), what can i use instead of "time" to make the script use the time variable from the first line(function pause(time) {)?

    <img src="http://bst82551.ath.cx:8080/cam_1.jpg" name="cam" onLoad="pause(3000)" onError="stop()">

    ^^ this is the part in the body that displays the refreshed images.

    Brian

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You don't have to post your question in multiple threads.

    http://www.codingforums.com/showthre...489#post263489
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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