Connecting Tech Pros Worldwide Forums | Help | Site Map

Image gallery works great in IE but not Firefox

Newbie
 
Join Date: Sep 2007
Posts: 3
#1: Sep 3 '07
Hi
This page http://www.dabhand.co.nz/ayupdev/gallery-riders.html works great in IE but not in Firefox... any help would be appreciated. It refers to an external javascript file which I have included the code to below:

The file name is imgriders.js - as referred to in source of the html file above.

Expand|Select|Wrap|Line Numbers
  1. if (document.images) {
  2. image1 = new Image;
  3. image2 = new Image;
  4. image3 = new Image;
  5. image4 = new Image;
  6. image5 = new Image;
  7. image1.src = 'images\\gallery\/riders1.jpg';
  8. image2.src = 'images\\gallery\/riders2.jpg';
  9. image3.src = 'images\\gallery\/riders3.jpg';
  10. image4.src = 'images\\gallery\/riders4.jpg';
  11. image5.src = 'images\\gallery\/riders5.jpg';
  12. } else {
  13. image1 = '';
  14. image2 = '';
  15. image3 = '';
  16. image4 = '';
  17. image5 = '';
  18. document.rollimg = '';
  19. }

pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#2: Sep 3 '07

re: Image gallery works great in IE but not Firefox


Heya, dabhand. Welcome to TSDN!

Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
Familiar Sight
 
Join Date: Feb 2007
Posts: 207
#3: Sep 4 '07

re: Image gallery works great in IE but not Firefox


Quote:

Originally Posted by dabhand

image1.src = 'images\\gallery\/riders1.jpg';
image2.src = 'images\\gallery\/riders2.jpg';
image3.src = 'images\\gallery\/riders3.jpg';
image4.src = 'images\\gallery\/riders4.jpg';
image5.src = 'images\\gallery\/riders5.jpg';

Why are you using a combination of slashes and backslashes? On web pages always use forward slashes as directory separators, and there's no need to escape them in string literals.
Expand|Select|Wrap|Line Numbers
  1. image1.src = 'images/gallery/riders1.jpg';
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,577
#4: Sep 4 '07

re: Image gallery works great in IE but not Firefox


Aren't your 'escapes' wrong for the images?
Newbie
 
Join Date: Sep 2007
Posts: 3
#5: Sep 4 '07

re: Image gallery works great in IE but not Firefox


Yahoo... thanks everyone I've got it working now. :-)) dabhand
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#6: Sep 4 '07

re: Image gallery works great in IE but not Firefox


Heya, dabhand.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Reply


Similar JavaScript / Ajax / DHTML bytes