SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Apr 30, 2007, 16:47 #1
- Join Date
- Apr 2007
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Error in FireFox: document.getElementById (imageid) has no properties
Hi,
I have an image slideshow that works in IE, but not FireFox. In the FireFox Error Console, it says
document.getElementById(imageid) has no properties
Source file: http://www.2gstudio.com/kr/amore/includes/blendtrans.js
Line: 44
Code:document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
The slideshow rotates great in IE, but in FireFox it just stays on the first image.
I don't have a lot of experience in JS, so any information as to why it fails in FireFox would be much appreciated.
Thank you!
-
Apr 30, 2007, 18:56 #2
- Join Date
- Sep 2006
- Posts
- 731
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
document.getElementById(imageid) has no properties
'img1' needs to be the id attribute of the target image, not its name attribute. Also you have the id of the image set to '1', but IDs are not permitted to start with a digit.Tab-indentation is a crime against humanity.
Bookmarks