Results 1 to 3 of 3

Thread: links/javascript not working in Firefox

  1. #1
    Join Date
    Jun 2008
    Posts
    192
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default links/javascript not working in Firefox

    Please open Firefox and go to http://www.surrealsource.com.

    You might have to wait a few minutes for the page to fully download, but once it does, try clicking on any thumb on the left. Nothing happens, right? In any other browser, the user is able to click on a thumb and have an enlarged view of that image appear in the main viewing area. But not in Firefox.

    Why?

    Here's some of my code:

    I'm using a motion gallery, the source of which can be found at:
    http://www.dynamicdrive.com/dynamici...iongallery.htm

    Here's an example entry in the gallery:

    Code:
    <tr><td><a href="#nogo" onclick="changePic(MAGIC_SHOW);return false;"><img src="thumbs/magic_show.jpg" border=1></a><br>Magic Show</td></tr>
    Here's my code for changePic:

    Code:
    function changePic(num) {
    
    	textdiv.style.display = "none"; // visible on first page load
    	picdiv.style.display = "inline"; // where main picture is displayed
    	infodiv.style.display = "inline"; // info on current picture (date, title, comments) to right of picdiv
    
    	nextlink.innerHTML = "NEWER >>";
    	prevlink.innerHTML = "<< OLDER";
    
    	mainpic.src="mainpics/"+files[num];
    	title.innerHTML = titles[num];
    	date.innerHTML = dates[num];
    	comment_body.innerHTML = comments[num];
    
    	cur_pic=num;
    
    	if (cur_pic == last_pic) {
    		nextlink.style.display = "none";
    	}
    	else {
    		nextlink.style.display = "inline";
    	}
    
    	if (cur_pic == first_pic) {
    		prevlink.style.display = "none";
    	}
    	else {
    		prevlink.style.display = "inline";
    	}
    ...
    }
    Can anyone see the problem? Is it in my changePic function? Is it the "#nogo" value being assigned to the href attribute? What is it?

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    function changePic(num) {
    	document.getElementById('textdiv').style.display = "none";
        document.getElementById('picdiv').style.display = "inline";
        document.getElementById('infodiv').style.display = "inline";
    
    	document.getElementById('nextlink').innerHTML = "NEWER >>";
    	document.getElementById('prevlink').innerHTML = "<< OLDER";
    
    	document.getElementById('mainpic').src="mainpics/"+files[num];
    	document.getElementById('title').innerHTML = titles[num];
    	document.getElementById('date').innerHTML = dates[num];
    	document.getElementById('comment_body').innerHTML = comments[num];
    
    	cur_pic=num;
    
    	if (cur_pic == last_pic) {
    		document.getElementById('nextlink').style.display = "none";
    	}
    	else {
    		document.getElementById('nextlink').style.display = "inline";
    	}
    
    	if (cur_pic == first_pic) {
    		document.getElementById('prevlink').style.display = "none";
    	}
    	else {
    		document.getElementById('prevlink').style.display = "inline";
    	}
    
    	if (cur_pic == FRACTURES) {
    		//document.getElementById('fractureslink').setAttribute('href', '#nogo', 0);
    		document.getElementById('mainpic').onmouseover = function(){mainpic.src="mainpics/fractures_odd.jpg";};
    		document.getElementById('mainpic').onmouseout = function(){mainpic.src="mainpics/fractures_even.jpg";};
    		document.getElementById('mainpic').setAttribute('usemap', '#fracturesmap', 0);
    	}
    	else {
    		//document.getElementById('fractureslink').removeAttribute('href', 0);
    		document.getElementById('mainpic').onmouseover = function(){return;};
    		document.getElementById('mainpic').onmouseout = function(){return;};
    		document.getElementById('mainpic').removeAttribute('usemap', 0);
    	}
     return false;
    }
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Jun 2008
    Posts
    192
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    Thanks vwphilips,

    That did the trick!

Bookmarks

Posting Permissions

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