Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Creating a DOM based Image Rotator
- From: harvey.ramer at designdelineations.com (Harvey A. Ramer)
- Subject: [Javascript] Creating a DOM based Image Rotator
- Date: Thu Aug 18 12:12:54 2005
The script does run on Firefox but requires me to use "name" rather than "id". This is invalid XHTML. I would like to use the id attribute. I think it requires using getElementById and I'm not quite sure how to approach it. Probably simple. I'll get it when I have time if no one else has the immediate fix. Thanks, Harvey -----Original Message----- From: Flavio Gomes [mailto:flavio@xxxxxxxxxxxxxxxx] Sent: Thursday, August 18, 2005 1:11 PM To: [JavaScript List] Subject: Re: [Javascript] Creating a DOM based Image Rotator I think all you need to do is to change "document.rotateImg" (IE Only) by myObject = document.getElementById("rotateImg"); Am I wrong or your problem was: "My script doesnt run on Firefox"? If was that the reason then this should solve it. -- Flavio Gomes flavio@xxxxxxxxxxxxxxxx Harvey A. Ramer wrote: > I would like to convert this image rotator into a dom/XHTML compliant > script. Can anyone do this easily? It's extremely short. > > Thanks in advance. > > ----------------------------------------- > > rotateImages = new > Array("/images/rotate/1.jpg","/images/rotate/2.jpg","/images/rotate/3.jpg"," /images/rotate/4.jpg","/images/rotate/5.jpg","/images/rotate/6.jpg","/images /rotate/7.jpg","/images/rotate/8.jpg"); > thisImage = 0; > imageCt = rotateImages.length; > function rotate(){ > if (document.rotateImg.complete){ > thisImage++; > if (thisImage == imageCt){ > thisImage=0; > } > document.rotateImg.src = rotateImages[thisImage]; > setTimeout("rotate()", 6*1000) > } > } _______________________________________________ Javascript mailing list Javascript@xxxxxxxxxx https://lists.LaTech.edu/mailman/listinfo/javascript
- Follow-Ups:
- [Javascript] Creating a DOM based Image Rotator
- From: Triche Osborne
- [Javascript] Creating a DOM based Image Rotator
- References:
- [Javascript] Creating a DOM based Image Rotator
- From: Flavio Gomes
- [Javascript] Creating a DOM based Image Rotator
- Prev by Date: [Javascript] Creating a DOM based Image Rotator
- Next by Date: [Javascript] Encoding Unicode characters in HTML
- Previous by thread: [Javascript] Creating a DOM based Image Rotator
- Next by thread: [Javascript] Creating a DOM based Image Rotator
- Index(es):