M
mr.mattyg
I might as well start off like everyone else who posts problems they
are having....So I'm new to JavaScript.....
Anywho, I have a page that lists 15 or so thumbnails and then one big
image of one of those thumbnails. I wrote some javascript code that
when you click on the thumbnail the real picture of that thumbnail
loads in the big image on the page. So essentially I wrote some very
simple code that replaces the "src" of an image tag on an onClick
event. I also replace some text within some elements that are tagged
with an ID. Everything works great in all browsers except in internet
explorer 6.0 (and possibly other versions of IE, just 6.0 is all I'm
using). If anyone has run into this problem before, or notices
something wrong with the code, any insight would be GREAT. Thanks
All,
/*******************JAVA SCRIPT FUNCTION***********************/
<script type="text/javascript">
function click(name, title, susser, photographer, location)
{
fool = "http://www.gnarwire.com/photos/guest/" + name;
document.photo.src = fool;
document.getElementById('picTitle').innerHTML= title + " in " +
location;
document.getElementById('picSusser').innerHTML= susser;
document.getElementById('picPhotographer').innerHTML= photographer;
}
</script>
/****************THUMBNAIL SECTION*********************/
<a class="thumbnail">
<img src="photos/guest/th256347_2Aguille du Midi 034.jpg"
onclick="click('256347_2Aguille du Midi 034.jpg', 'Crevasse Rescue
Training', 'Topher Plimpton', 'Mike Schirf', 'Mer de Glace');"
border="0" width="70px" height="70px">
</a>
<a class="thumbnail">
<img src="photos/guest/th256346_poubell 003.jpg"
onclick="click('256346_poubell 003.jpg', 'Harny Suss\'n Le Poubelle',
'Johannes Schmid', 'Mike Schirf', 'Chamonix');" border="0"
width="70px" height="70px">
</a>
<a class="thumbnail">
<img src="photos/guest/th256345_MattToph.jpg"
onclick="click('256345_MattToph.jpg', 'Mt. Blanc', 'Topher and Matt',
'Mike Schirf', 'Mt. Buet -- Chamonix');" border="0" width="70px"
height="70px">
</a>
/*********************BIG IMAGE SECTION********************/
<div class="post" id="post-1">
<H2 id="picTitle">
Crevasse Rescue Training in Mer de Glace
</H2>
<div class="entry">
<img src="photos/guest/256347_2Aguille du Midi 034.jpg" name="photo">
</div>
<div class="postmetadata">
<h3 align="center">
<span> Susser: </span>
<span id="picSusser">Topher Plimpton</span>
   
<span> Photographer:<span>
<span id="picPhotographer">Mike Schirf</span> </h3>
</div>
</div>
are having....So I'm new to JavaScript.....
Anywho, I have a page that lists 15 or so thumbnails and then one big
image of one of those thumbnails. I wrote some javascript code that
when you click on the thumbnail the real picture of that thumbnail
loads in the big image on the page. So essentially I wrote some very
simple code that replaces the "src" of an image tag on an onClick
event. I also replace some text within some elements that are tagged
with an ID. Everything works great in all browsers except in internet
explorer 6.0 (and possibly other versions of IE, just 6.0 is all I'm
using). If anyone has run into this problem before, or notices
something wrong with the code, any insight would be GREAT. Thanks
All,
/*******************JAVA SCRIPT FUNCTION***********************/
<script type="text/javascript">
function click(name, title, susser, photographer, location)
{
fool = "http://www.gnarwire.com/photos/guest/" + name;
document.photo.src = fool;
document.getElementById('picTitle').innerHTML= title + " in " +
location;
document.getElementById('picSusser').innerHTML= susser;
document.getElementById('picPhotographer').innerHTML= photographer;
}
</script>
/****************THUMBNAIL SECTION*********************/
<a class="thumbnail">
<img src="photos/guest/th256347_2Aguille du Midi 034.jpg"
onclick="click('256347_2Aguille du Midi 034.jpg', 'Crevasse Rescue
Training', 'Topher Plimpton', 'Mike Schirf', 'Mer de Glace');"
border="0" width="70px" height="70px">
</a>
<a class="thumbnail">
<img src="photos/guest/th256346_poubell 003.jpg"
onclick="click('256346_poubell 003.jpg', 'Harny Suss\'n Le Poubelle',
'Johannes Schmid', 'Mike Schirf', 'Chamonix');" border="0"
width="70px" height="70px">
</a>
<a class="thumbnail">
<img src="photos/guest/th256345_MattToph.jpg"
onclick="click('256345_MattToph.jpg', 'Mt. Blanc', 'Topher and Matt',
'Mike Schirf', 'Mt. Buet -- Chamonix');" border="0" width="70px"
height="70px">
</a>
/*********************BIG IMAGE SECTION********************/
<div class="post" id="post-1">
<H2 id="picTitle">
Crevasse Rescue Training in Mer de Glace
</H2>
<div class="entry">
<img src="photos/guest/256347_2Aguille du Midi 034.jpg" name="photo">
</div>
<div class="postmetadata">
<h3 align="center">
<span> Susser: </span>
<span id="picSusser">Topher Plimpton</span>
   
<span> Photographer:<span>
<span id="picPhotographer">Mike Schirf</span> </h3>
</div>
</div>