Sebastian Becker: MouseOver-Script funktioniert nicht

Hallo,

auf der Suche nach einem kompatiblen und einfach zu implementierenden MouseOver-Script habe ich mich für das folgende entschieden:

---------- schnipp ----------

// in externer .js-Datei:

var flag = false;

// load the on images, called with body onLoad()
function imageLoad()
{
if (document.images)
{
pic1on = new Image();
pic1on.src = "pictures/bild_on.gif";

// set the flag and let the function know know it can work          
return (flag = true);
}
}

if (document.images)
{
// load the off images in the normal way
pic1off = new Image();
pic1off.src = "pictures/bild.gif";
}

function rollIn(picName)
{
if (document.images && (flag == true))
{
document[picName].src = eval(picName + "on.src");
}
}
// the normal onMouseOut function
function rollOut(picName)
{
if (document.images)
{
document[picName].src = eval(picName + "off.src");
}
}

// und im body:

<a href="link.htm" onMouseOver="rollIn('pic1');return true" onMouseOut="rollOut('pic1');return true;"><img src="pictures/bild.gif" alt="zurück (nach Lage)" name="pic1"></a>

---------- schnipp ----------

Leider funktioniert es überhaupt nicht und meine Fehlersuche blieb bislang erfolglos. Vielleicht genügt der kurze Blick eines Profis, um den Fehler zu finden?!

Danke, Grüße,

Sebastian Becker

  1. Hallo,

    wozu glaubst Du eigentlich gibt es _neben_ SelfHTML das Forum? Wohl kaum um Probleme zu klären die in SelfHTML selbst schon drin stehen, oder? Also lies Dir doch 'mal <../../tedg.htm> durch und nimmt diesen Quelltext bevor Du Dir irgendwo einen suchst und nicht damit zurecht kommst.

    Gruße aus Bayreuth
    JUlian

    P.S: Sorry, daß ich etwas agressiv antworte. Ich finde es aber langsam einfach nervig, daß niemand mehr im Archiv sucht, in SelfHTML blättert oder einfach 'mal nachdenkt. Das Forum wird mehr und mehr einfach zu einer Müllkippe und die wahren und interessanten Themen gehen unter.