I’m pretty new to JS but I think I’m picking it up not too bad. This problem has perplexed me though. I’m trying to use Prototype and Scriptaculous:
[CODE]var gameInfo = Class.create();
gameInfo.prototype = {
initialize: function() {
if (!document.getElementsByTagName){ return; }
var anchors = document.getElementsByTagName(‘a’);
// loop through all anchor tags
for (var i=0; i<anchors.length; i++){
var anchor = anchors[i];
if (anchor.getAttribute(‘href’) && anchor.getAttribute(‘class’) == ‘gameTitle’){
anchor.onclick = function () {myGameInfo.start(); return false;}
}
}
},
start: function() {
new Effect.toggle(‘gameInfo’, ‘slide’);
}
}
function initGameInfo() { myGameInfo = new gameInfo(); }
Event.observe(window, ‘load’, initGameInfo, false);
I’ll admit, I’ve based a lot of this code on Lightbox2.0 but it does something much simpler.
If you go to [URL=http://psf.gamehideout.co.uk/dah.php]this (work-in-progress) page
I know I could get that effect without the above code but I needed it to degrade gracefully. This way people without JS can view the same content but on another page (doesn’t work yet as the site is very incomplete).
If anyone can shed light on why this doesn’t work in IE I’d be very grateful ?