this goes in a new js document
/ JavaScript Document
(function() {
var imgs = new Array(); var imgcnt = 0; var thisimg = 0;
imgs[imgcnt++] = '_images/owl2.png';
imgs[imgcnt++] = '_images/owl3.png';
imgs[imgcnt++] = '_images/owl4.png';
imgs[imgcnt++] = '_images/owl5.png';
imgs[imgcnt++] = '_images/owl6.png';
imgs[imgcnt++] = '_images/owl7.png';
imgs[imgcnt++] = '_images/owl8.png';
function rotate() {
if (document.images) {
thisimg++;
if (thisimg >= imgcnt) thisimg = 0;
document.getElementById('rollimg').src = imgs[thisimg];
}
}
setInterval(rotate,200);
})();
save as image1.js or something
this goes in the head of your html document
<script src="image1.js"></script>
No comments:
Post a Comment