[thelist] My js works in FF and Opera but not IE6 or 7
Chris Price
chris.price at choctaw.co.uk
Tue Jul 22 18:15:45 CDT 2008
Can anyone see why this doesn't work on Internet Explorer (6 or 7)?
Its simply a bunch of thumbnails that, when clicked, change the larger
display image (galleryFocus).
Each image has its own id. It doesn't bring up any error, it just
doesn't fire the displayLarge function.
<script>
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') { window.onload = func; }
else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(function() {
var gallery = document.getElementById('content')
var myImages = gallery.getElementsByTagName('img')
var i
var MyImg = {}
for (i in myImages) {
if (isInteger(i)) {
MyImg = myImages[i]
var imgClassObject = myImages[i].getAttributeNode('id')
if (imgClassObject != null) {
MyImg.img = 'images/gallery/' + imgClassObject.value +
'.jpg'
MyImg.onclick = displayLarge
}
}
}
})
function displayLarge() {
var myDestination = document.getElementById('galleryFocus')
myDestination.src = this.img
}
function isInteger(s) {
return (s.toString().search(/^-?[0-9]+$/) == 0);
}
</script>
--
Kind Regards
Chris Price
Choctaw
chris.price at choctaw.co.uk <mailto:chris.price at choctaw.co.uk>
www.choctaw.co.uk <http://www.choctaw.co.uk>
Tel. 01524 825 245
Mob. 0777 451 4488
Beauty is in the Eye of the Beholder while
Excellence is in the Hand of the Professional
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Sent on behalf of Choctaw Media Ltd <<
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Choctaw Media Limited is a company registered in
England and Wales with company number 04627649
Registered Office: Lonsdale Partners, Priory Close,
St Mary's Gate, Lancaster LA1 1XB . United Kingdom
More information about the thelist
mailing list