 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
jimroberth
Joined: 18 Sep 2004 Posts: 4
|
Posted: Sat Sep 18, 2004 9:43 am Refresh one image only |
|
|
|
I want to refresh only the main image on a motion jpeg page not the whole page. Any ideas.
Thanks |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Mon Sep 20, 2004 5:51 am |
|
|
|
| Code: |
<!-- Code Begin -->
<IMG src="image_name.jpg" width="275" height="200" border="1" name="refresh">
<SCRIPT language="JavaScript" type="text/javascript">
<!--
var t = 120 // interval in seconds
image = "image_name.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>
<!-- Code End --> |
Try this one - I use it to refresh my webcam pics. Just insert your on image address and interval time |
|
jimroberth
Joined: 18 Sep 2004 Posts: 4
|
Posted: Mon Sep 20, 2004 6:48 pm Great |
|
|
|
Just what I wanted. Thanks, I owe you a beer.
Jim H |
|
orbital
Joined: 11 Oct 2004 Posts: 8
|
Posted: Mon Oct 11, 2004 10:55 pm |
|
|
|
would this work with a random background image reloaded at a specific interval?
thanks in advance....just joined having a good look around  |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Tue Oct 12, 2004 3:12 am |
|
|
|
One of our websites uses this script to generate a random top banner image.
This is the site
http://www.crescohomes.com
Here is the script in the HEAD portion
| Code: |
<SCRIPT LANGUAGE=JavaScript><!-- Hide this script from old browsers --
var imagenumber = 7 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "banner1.jpg"
images[2] = "banner2.jpg"
images[3] = "banner3.jpg"
images[4] = "banner4.jpg"
images[5] = "banner5.jpg"
images[6] = "banner6.jpg"
images[7] = "banner7.jpg"
var image = images[rand1]
// -- End Hiding Here --></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- Hide this script from old browsers --
var imagenumber = 5 ;
var randomnumber = Math.random() ;
var rand2 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "frontpic1.jpg"
images[2] = "frontpic2.jpg"
images[3] = "frontpic3.jpg"
images[4] = "frontpic4.jpg"
images[5] = "frontpic5.jpg"
var image2 = images[rand2]
// -- End Hiding Here --></SCRIPT> |
This code is the BODY portion
| Code: |
<BODY BGCOLOR="#DBDFD4" marginheight=0 topmargin=0 marginwidth=0 leftmargin=0>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=621 HEIGHT=77 align="center">
<tr>
<td><img src="topbanner.gif" width="620" height="27" align="top" alt="Top Banner"></td>
</tr>
<TR>
<TD VALIGN=top>
<P><IMG SRC="toplogo.gif" ALT="Cresco Homes" WIDTH=189 HEIGHT=77 ALIGN=top><SCRIPT LANGUAGE=JavaScript><!-- Hide this script from old browsers --
document.write('<IMG SRC="' + image + '" width=431 height=77 align=top>')
// -- End Hiding Here --></SCRIPT>
</TD>
</TR> |
Perhaps the "' + image + '" can be placed in the BODY tag for the background image. Play with it and see what happens. |
|
orbital
Joined: 11 Oct 2004 Posts: 8
|
Posted: Tue Oct 12, 2004 1:48 pm |
|
|
|
thanks mjpliv
i'll work on that later on tonight, and report back how it goes
appreciate your help
orb |
|
mjpliv

Joined: 11 May 2004 Posts: 402 Location: Nova Scotia
|
Posted: Tue Oct 12, 2004 3:04 pm |
|
|
|
| I have no idea if it will work - Java is not a strong point for me. |
|
Digi Spy
Joined: 28 Dec 2004 Posts: 1
|
Posted: Tue Dec 28, 2004 2:22 pm |
|
|
|
Hi, I'm new around here, so please excuse me if this had already been asked somewhere..
Is there a way, possibly using the code provided in this topic to refresh a single remotely-hosted (webcam) image with another remotely-hosted (webcam) image (different URL) on the same webpage after a few seconds delay without having to use a META refresh command to auto-load a new page, and a new image, I would also (if possible) like with a small caption above the image (which also changes with the image)?
Any and all help gratefully received. |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|