HTML onMouseover Problem

cpt_muh

Ensign
Registriert
März 2008
Beiträge
153
Ich habe folgendes Problem wenn ich mit der Maus über das bild gehe leuchtet es auf so wie es sein soll geh ich aber wieder runter bleibt es erleuchtet. Sieht jemand den Fehler in meinem Script bzw Code?

HTML:
<head>
<script language="JavaScript"> 
home_over= new Image; home_over.src = "images/home_over.jpg" 
home= new Image; home.src = "images/home.jpg" 


</script> 
</head>
<body>

<a href="index.html" target="_self" 

onmouseover="home.src=home_over.src;" 
onmouseout="home.src=home.src">
<img src="images/Home.jpg" width="56" height="21" border="0" alt="Startseite" name="home"></a>

</body>
 
Hallo,

Versuchs so

HTML:
<head>

</head>
<body>

<img onmouseover="document.getElementById('img').src='pic2.jpg';" onmouseout="document.getElementById('img').src='pic.jpg';" src="pic.jpg" width="56" height="21" border="0" id="img" alt="Startseite" name="home"></img>

</body>

mfg
 
ok danke für den Code. Aber jetzt ist es immer noch das gleiche Problem komischer weise und mein Design wird zerpflückt also die spalten verrutschen um 2 px
 
Ich verstehe nicht genau was du meinst? zeig mal mehr code und eventuell einen screenshot.
 
Zuletzt bearbeitet:
mitos schrieb:
Ich verstehe nicht genau was du meinst? zeig mal mehr code und eventuell einen screenshot.

HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<title>www.poehler-zuchel.de</title>
<meta name="Robert Weber" content="Robert Weber">
<meta name="editor" content="html-editor phase 5">
<script
language="JavaScript">

home_over= new Image;
home_over.src = "images/home_over.jpg"
home= new Image;
home.src = "images/home.jpg"

mode_over= new Image;
mode_over.src = "images/mode_over.jpg"
mode= new Image;
mode.src = "images/mode.jpg"

</script>

</head>
<center>
<table id="Tabelle_01" width="1024" height="693" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="11">
			<img src="images/head.jpg" width="1024" height="86" alt=""></td>
	</tr>
	<tr>
		<td rowspan="2">
			<img src="images/menu.jpg" width="87" height="31" alt=""></td>
		<td>
			<a href="index.html" target="_self"
				onmouseover="home.src=home_over.src;"
				onmouseout="home.src=home.src">
				<img src="images/Home.jpg" width="56" height="21" border="0" alt="Startseite" name="home"></a></td>
		<td rowspan="2">
			<img src="images/point.jpg" width="14" height="31" alt=""></td>
		<td>
			<a href="mode.html" target="_self"
				onmouseover="mode.src=mode_over.src;"
				onmouseout="window.status='';  return true;">
				<img src="images/Mode.jpg" width="56" height="21" border="0" alt="mode" name="mode"></a></td>
		<td rowspan="2">
			<img src="images/point-06.jpg" width="16" height="31" alt=""></td>
		<td>
			<a href="agentur.html" target="_self"
				onmouseover="window.status='Agentur';  return true;"
				onmouseout="window.status='';  return true;">
				<img src="images/Agentur.jpg" width="78" height="21" border="0" alt="Agentur" name="agentur"></a></td>
		<td rowspan="2">
			<img src="images/point-08.jpg" width="18" height="31" alt=""></td>
		<td>
			<a href="plus.html" target="_self"
				onmouseover="window.status='Plus';  return true;"
				onmouseout="window.status='';  return true;">
				<img src="images/Plus.jpg" width="41" height="21" border="0" alt="Plus"></a></td>
		<td rowspan="2">
			<img src="images/point-10.jpg" width="11" height="31" alt=""></td>
		<td>
			<a href="kontakt.html" target="_self"
				onmouseover="window.status='Kontakt';  return true;"
				onmouseout="window.status='';  return true;">
				<img src="images/Kontakt.jpg" width="76" height="21" border="0" alt="Kontakt"></a></td>
		<td rowspan="2">
			<img src="images/menu-12.jpg" width="571" height="31" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/spacer.jpg" width="56" height="10" alt=""></td>
		<td>
			<img src="images/spacer-14.jpg" width="56" height="10" alt=""></td>
		<td>
			<img src="images/spacer-15.jpg" width="78" height="10" alt=""></td>
		<td>
			<img src="images/spacer-16.jpg" width="41" height="10" alt=""></td>
		<td>
			<img src="images/spacer-17.jpg" width="76" height="10" alt=""></td>
	</tr>
	<tr>
		<td colspan="11">
			<img src="images/content.jpg" width="1024" height="326" alt=""></td>
	</tr>
	<tr>
		<td colspan="11">
			<img src="images/foot.jpg" width="1024" height="250" alt=""></td>
	</tr>
</table>
</center>
</body>
</html>

1233gj0.jpg
 
Den Code hast du aber noch nicht angepasst. Versuche es genauso einzubauen, wie ich dir im Beitrag vorhin geschriebem habe. Ich habs im Firefox getestet und da funktionierts einwandfrei. Kontrollier eventuell ob die Pfadangaben korrekt sind.


mfg
 
Zuletzt bearbeitet:
mitos schrieb:
Hallo,

Versuchs so

[...]

mfg

schon niocht schlecht aber kürzer is so
HTML:
<head>

</head>
<body>

<img onmouseover="this.src='pic2.jpg';" onmouseout="this.src='pic.jpg';" src="pic.jpg" width="56" height="21" border="0" alt="Startseite" name="home"></img>

</body>
 

Ähnliche Themen

Zurück
Oben