i have decided to change the script up a little because the last one seemed to be a little buggy, but now i seem to be having some problems with this one. Like- I'll click the one to make the pic refresh every 30 seconds. It will refresh after 30 seconds, but then it just seems to stop working and will not refresh again.
Code:
<script language="JavaScript"><!--
function pause(time) {
setTimeout('refresh()',time);
}
function pause3() {
document.images['cam'].onload = 'pause(3000)';
setTimeout('refresh()',3000);
}
function pause10() {
document.images['cam'].onload = 'pause(10000)';
setTimeout('refresh()',10000);
}
function pause30() {
document.images['cam'].onload = 'pause(30000)';
setTimeout('refresh()',30000);
}
function refresh() {
document.images['cam'].src = 'http://bst82551.ath.cx:8080/cam_1.jpg?' + Math.random();
}
function stop() {
document.images['cam'].src = 'http://bst82551.ath.cx:8181/status/images/camoff.jpg';
document.images['cam'].onload = '';
}
//--></script>
here are the links i've created for this... and the image itself.
Code:
<font size=2>
<a href="#" onclick="pause3()" title="3 seconds">3</a> -
<a href="#" onclick="pause10()" title="10 seconds">10</a> -
<a href="#" onclick="pause30()" title="30 seconds">30</a>
</font>
<br>
<img src="http://bst82551.ath.cx:8080/cam_1.jpg" name="cam" onLoad="pause(3000)" onError="stop()">
Brian