View Single Post
  #4 (permalink)  
Old Sep 27th, 2007, 11:47
Rakuli's Avatar
Rakuli Rakuli is offline
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Changing image not working in Firefox

Hi Poet,

I probably wouldn't use eval() for this, you would be able to acheive it much easier with the DOM.

if you changed your function to be

Code: Select all
<script type="text/javascript">
<!--
var currentPic = "Album1";

function hot(name){
 
    document.getElementById(currentPic).style.display = 'none';
    document.getElementById(name).style.display = 'inline';
    document.getElementById('mainPic').src = name + '.JPG';

    currentPic = name;

  }
// -->
</script>
That should work in all DOM compatible browsers.

Cheers,
Reply With Quote