www.webdeveloper.com
Results 1 to 3 of 3

Thread: firefox issue

  1. #1
    Join Date
    May 2010
    Posts
    2

    Unhappy firefox issue

    Hello,

    I'm new to javascript and having trouble with a site i'm building. There are an up and down arrow which are used to switch the main image.

    They work fine in Internet Explorer, but do not function in Firefox. Any help would be greatly appreciated. The site is at http://www.killabilla.co.uk/jonny

    Many thanks,

    William Dixon

  2. #2
    Join Date
    Aug 2009
    Posts
    593
    I don't think FireFox likes referring to an element directly.

    Try something like this in your swapImage function...

    Code:
    var intImage = 2;
    
    function swapImage()
    {
    	switch (intImage) {
    		case 1:
    			document.getElementById("IMG1").src = "images/watch.png";
    			intImage = 2;
    			break;
    		case 2:
    			document.getElementById("IMG1").src = "images/watch2.png";
    			intImage = 1;
    			break;
    	}
    }

  3. #3
    Join Date
    May 2010
    Posts
    2

    Thanks!!!

    Issue Sorted Thanks for your Quick Reply! I'm new to javascript found this script on the net and have been trying to fix this for days!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles