SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with 2 images auto refreshing

    Basically I have 2 cameras taking pictures every minute and uploading them to a website every minute. I want just the images only to auto refresh every minute. I have this code in there and it works for one image but how do i add a second. The second picture is right beside the first one on same page. The second image is camera2 and also has width 49%. I left that out for someone to help fill in what it should look like.

    Thank you!

    Mike

    <img src="webcam/camera1.jpg" width="49%" name="refresh">

    <script language="javascript" type="text/javascript">
    <!--
    var t = 60 // interval in seconds
    image = "webcam/camera1.jpg" //name of the image
    function Start() {
    tmp = new Date();
    tmp = "?"+tmp.getTime()
    document.images["refresh"].src = image+tmp
    setTimeout("Start()", t*1000)
    }
    Start();
    // -->
    </script>

  2. #2
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can anyone help? please!

  3. #3
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rotomike View Post
    can anyone help? please!
    try this, I just discovered the same thing today

  4. #4
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I take it the visiongs should come out of the code or does it need to be there? If it comes out then what do you replace it with if anything?

    mike

  5. #5
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rotomike View Post
    I take it the visiongs should come out of the code or does it need to be there? If it comes out then what do you replace it with if anything?

    mike
    no
    just put the image source in the IMG src= line after the </SCRIPT> line
    in place of 'cam1.jpg'

  6. #6
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok Thanks! I will give it a try this weekend when i get a chance to play with it.

    Mike


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
  •