By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,350 Members | 1,507 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,350 IT Pros & Developers. It's quick & easy.

Image gallery works great in IE but not Firefox

P: 3
This page 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. }
Sep 3 '07 #1
Share this Question
Share on Google+
5 Replies

Expert 5K+
P: 5,821
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.
Sep 3 '07 #2

P: 210
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';
Sep 3 '07 #3

Expert 5K+
P: 7,435
Aren't your 'escapes' wrong for the images?
Sep 3 '07 #4

P: 3
Yahoo... thanks everyone I've got it working now. :-)) dabhand
Sep 4 '07 #5

Expert 5K+
P: 5,821
Heya, dabhand.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Sep 4 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.