View Full Version : Refreshing Images
Erikina
05-25-2004, 05:59 AM
I would like to create a page, with images that refresh; i do not want the whole page refreshing does anyone know how this can be done...
Please include src code
Thank you very much
beefa
05-25-2004, 06:06 AM
what it sounds like you need is a slideshow? i have a slideshow src file on my website (not running yet) and its perfect!
src:
paste this between the <head> and </head> tages
<script language="JavaScript1.1">
<!--
//specify interval between slide (in mili seconds)
var slidespeed=3000
//specify images
var slideimages=new Array("contwo.jpg","image1.jpg","image2.jpg","image3.jpg")
//specify corresponding links
var slidelinks=new Array("","","")
var imageholder=new Array()
var ie55=window.createPopup
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}
function gotoshow(){
alert("Image freezed until you click ok");
}
//-->
</script>
paste this in your <Body> tag
<a href="javascript:gotoshow()"><img src="photo1.jpg" name="slide" border=0 style="filter:progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,Duration=1)"></a>
<script language="JavaScript1.1">
<!--
var whichlink=0
var whichimage=0
var pixeldelay=(ie55)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie55) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie55) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+pixeldelay)
}
slideit()
//-->
</script>
to change the images, edit the text in the <head> part of the script. also, when a image is shown, you can have a link attached (href).
any questions, dont hesitate to ask
beef
Erikina
05-27-2004, 07:29 AM
Thank you, but I am not looking for a slideshow but refreshing images as in
pic.jpg ...two seconds later it reloads pic.jpg without the whole page
Is this achievable or do i need to refresh the whole page?
Willy Duitt
05-27-2004, 09:55 AM
<script type="text/javascript">
function newImage(){
if(document.images){
document.images['imageName'].src = 'pic.jpg?' +
Date.parse(new Date().toString());
} setTimeout(newImage,2000);
}
</script>
</head>
<body onload="newImage()">
<img name="imageName" src="pic.jpg">
beefa
05-28-2004, 11:30 PM
i dont see the need for refreshing only one image, but u can use my slideshow, and instead of entering 3 or 4 images, only enter the one.
set the timer in the script to what u want and it will refresh the image.
hope this helps,
curtis
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.