Hi Everyone,
New to Javascript so please forgive the messiness, but I am going nuts over trying to get the following to work in Firefox. It seems to work just fine in IE. I believe it's a matter of the GetElementsByTagName method?
Appreciate any help. Thanks.
Paul
<div style="visibility:hidden;" id="imageGal" cnt="02" alt="Enlarged View of Front, rider only">18</div>
<div style="visibility:hidden;" id="imageGal" cnt="03" alt="Enlarged View of Front, Example">18</div>
<script type="text/javascript"><!--
allDivs = document.getElementsByTagName("div");
var allImages = new Array();
imgCount = 0;
for(i=0;i<allDivs.length;i++) {
if (allDivs.id == "imageGal") {
allImages
= allDivs;
imgCount = imgCount + 1;
}
}
document.write('<font class="subtitle">More Images<\/font>');
document.write('<p align="left"><div id="showimage"><\/div>');
document.write('<table class=prodtableborder cellspacing="0" cellpadding="2" border=0 style="border-collapse:collapse;"><tbody><tr>');
for(i=0;i<allImages.length;i++) {
imageNum = allImages.innerHTML;
imageAlt = allImages.alt;
imageCnt = allImages.cnt;
imagePath = 'ProductImages\/' + imageNum + '\/large' + imageCnt + '.gif';
thumbPath = 'ProductImages\/' + imageNum + '\/thumb' + imageCnt + '.gif';
document.write('<td align="center" valign="middle">');
document.write('<a title="' + imageAlt + '" href="' + imagePath + '" onClick="return enlarge(\'' + imagePath + '\',event,\'center\',450,450)"><img border="0" src="' + thumbPath + '" width="135" height="135"><\/a><\/td>');
}
document.write('<\/tr><tr><td class="prodtextbold" colspan="2" align="center" valign="middle" bgcolor="\#CCCCCC">Click On Image for Larger View<\/td>');
document.write('<td align="center" valign="middle"><\/td><\/tr><\/tbody><\/table><\/p>');
//--></script>
New to Javascript so please forgive the messiness, but I am going nuts over trying to get the following to work in Firefox. It seems to work just fine in IE. I believe it's a matter of the GetElementsByTagName method?
Appreciate any help. Thanks.
Paul
<div style="visibility:hidden;" id="imageGal" cnt="02" alt="Enlarged View of Front, rider only">18</div>
<div style="visibility:hidden;" id="imageGal" cnt="03" alt="Enlarged View of Front, Example">18</div>
<script type="text/javascript"><!--
allDivs = document.getElementsByTagName("div");
var allImages = new Array();
imgCount = 0;
for(i=0;i<allDivs.length;i++) {
if (allDivs.id == "imageGal") {
allImages
imgCount = imgCount + 1;
}
}
document.write('<font class="subtitle">More Images<\/font>');
document.write('<p align="left"><div id="showimage"><\/div>');
document.write('<table class=prodtableborder cellspacing="0" cellpadding="2" border=0 style="border-collapse:collapse;"><tbody><tr>');
for(i=0;i<allImages.length;i++) {
imageNum = allImages.innerHTML;
imageAlt = allImages.alt;
imageCnt = allImages.cnt;
imagePath = 'ProductImages\/' + imageNum + '\/large' + imageCnt + '.gif';
thumbPath = 'ProductImages\/' + imageNum + '\/thumb' + imageCnt + '.gif';
document.write('<td align="center" valign="middle">');
document.write('<a title="' + imageAlt + '" href="' + imagePath + '" onClick="return enlarge(\'' + imagePath + '\',event,\'center\',450,450)"><img border="0" src="' + thumbPath + '" width="135" height="135"><\/a><\/td>');
}
document.write('<\/tr><tr><td class="prodtextbold" colspan="2" align="center" valign="middle" bgcolor="\#CCCCCC">Click On Image for Larger View<\/td>');
document.write('<td align="center" valign="middle"><\/td><\/tr><\/tbody><\/table><\/p>');
//--></script>