Hi there..
I’m new at javascript and I’ve just watched a tutorial about the rolloers..
window.onload = rollInit;
function rollInit(){
for(var i=0; i
if(document.images.parentNode.tagName == "A"){
setupRoll(document.images);
}
}
}
function setupRoll(thisImage){
thisImage.outImage = new Image();
thisImage.outImage.src = thisImage.src;
thisImage.onmouseout = rollOut;
thisImage.overImage = new Image();
thisImage.overImage.src = "images/" + thisImage.id + "_on.gif";
thisImage.onmouseover = rollOver;
}
function rollOut(){
this.src = this.outImage.src;
}
function rollOver(){
this.src = this.overImage.src;
}
In this example, I’ve first realized, that in the setupRoll function where I have “new Image();” if i write “new Image;” is the absolutely the same thing.
But I can’t find anywhere an explanation of this..