Avatar billede kimlarsen Praktikant
29. november 1999 - 18:19 Der er 6 kommentarer og
1 løsning

Hvorfor virker min mouseover ikke ?

Er der nogen som vil være så venlig at forklare mig hvor det går galt !

<html>

<head>
<title>Inventors Place [Work Title]</title>
<script>
img = new Image;

function changeImg(imgName, target) {
  img.src = imgName;
  document[target].src = img.src;
}

</script>
</head>

<body>
<div align="left">

<table border="0" cellpadding="0" cellspacing="0" align="left">
  <tr>
    <th width="25%" valign="top" nowrap height="25%"></th>
    <th width="100" valign="top" nowrap height="25%"></th>
    <th width="100" valign="top" nowrap height="25%"></th>
    <th width="100" valign="top" nowrap height="25%"></th>
    <th width="100" valign="top" nowrap height="25%"></th>
    <th width="52" valign="bottom" nowrap height="25%"></th>
    <th width="52" valign="middle" nowrap height="25%"></th>
    <th width="52" valign="middle" nowrap height="25%"></th>
    <th width="25%" valign="middle" nowrap height="25%"></th>
  </tr>
  <tr>
    <th width="25%" valign="top" nowrap height="25"></th>
    <th width="100" valign="top" nowrap height="25"><img
src="images/pos/leo1-1.jpg"
    alt="leo1-1.jpg (1409 bytes)" width="100" height="50"></th>
    <th width="100" valign="top" nowrap height="25"><img
src="images/pos/leo1-2.jpg"
    alt="leo1-2.jpg (3522 bytes)" width="100" height="50"></th>
    <th width="100" valign="top" nowrap height="25"><img
src="images/pos/leo1-3.jpg"
    alt="leo1-3.jpg (1679 bytes)" width="100" height="50"></th>
    <th width="100" valign="top" nowrap height="25"><img
src="images/pos/leo1-4.jpg"
    alt="leo1-4.jpg (765 bytes)" width="100" height="50"></th>
    <th width="52" valign="bottom" nowrap height="25"
    onMouseover="changeImg('tandh.gif', 'pic1')"
onMouseout="changeImg('im1.gif', 'pic1')"><img
    src="images/pos/tandh.gif" border="1" alt="Firma Information"
name="pic1" width="50"
    height="35"></th>
    <th width="52" valign="middle" nowrap height="25"></th>
    <th width="52" valign="middle" nowrap height="25"></th>
    <th width="25%" valign="middle" nowrap height="25"></th>
  </tr>
  <tr>
    <th width="25%" height="100" valign="top" nowrap></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo2-1.jpg"
    alt="leo2-1.jpg (1413 bytes)" width="100" height="100"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo2-2.jpg"
    alt="leo2-2.jpg (6256 bytes)" width="100" height="100"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo2-3.jpg"
    alt="leo2-3.jpg (6822 bytes)" width="100" height="100"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo2-4.jpg"
    alt="leo2-4.jpg (3850 bytes)" width="100" height="100"></th>
    <th width="52" height="100" valign="middle" nowrap></th>
    <th width="52" valign="bottom" nowrap height="25"
    onMouseover="changeImg('tandh.gif', 'pic1')"
onMouseout="changeImg('im2.gif', 'pic1')"><img
    src="images/pos/tandh.gif" border="1" alt="Firma Information"
name="pic1" width="50"
    height="35"></th>
    <th width="52" height="100" valign="middle" nowrap></th>
    <th width="25%" height="100" valign="middle" nowrap></th>
  </tr>
  <tr>
    <th width="25%" height="100" valign="top" nowrap></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo3-1.jpg"
    alt="leo3-1.jpg (3954 bytes)" width="100" height="100"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo3-2.jpg"
    alt="leo3-2.jpg (6840 bytes)" width="100" height="100"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo3-3.jpg"
    alt="Website by Kim Larsen" width="100" height="100"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo3-4.jpg"
    alt="leo3-4.jpg (2806 bytes)" width="100" height="100"></th>
    <th width="52" height="100" valign="middle" nowrap></th>
    <th width="52" height="100" valign="middle" nowrap></th>
    <th width="52" valign="bottom" nowrap height="25"
    onMouseover="changeImg('tandh.gif', 'pic1')"
onMouseout="changeImg('im3.gif', 'pic1')"><img
    src="images/pos/tandh.gif" border="1" alt="Firma Information"
name="pic1" width="50"
    height="35"></th>
    <th width="25%" height="100" valign="middle" nowrap></th>
  </tr>
  <tr>
    <th width="25%" height="100" valign="top" nowrap></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo4-1.jpg"
    alt="leo4-1.jpg (4508 bytes)" width="100" height="68"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo4-2.jpg"
    alt="leo4-2.jpg (5573 bytes)" width="100" height="68"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo4-3.jpg"
    alt="leo4-3.jpg (2980 bytes)" width="100" height="68"></th>
    <th width="100" height="100" valign="top" nowrap><img
src="images/pos/leo4-4.jpg"
    alt="leo4-4.jpg (1000 bytes)" width="100" height="68"></th>
    <th width="52" height="100" valign="middle" nowrap></th>
    <th width="52" valign="bottom" nowrap height="25"
    onMouseover="changeImg('tandh.gif', 'pic1')"
onMouseout="changeImg('im4.gif', 'pic1')"><img
    src="images/pos/tandh.gif" border="1" alt="Firma Information"
name="pic1" width="50"
    height="35"></th>
    <th width="52" height="100" valign="middle" nowrap></th>
    <th width="25%" height="100" valign="middle" nowrap></th>
  </tr>
  <tr>
    <th width="25%" height="49" valign="top" nowrap></th>
    <th width="100" height="49" valign="top" nowrap><img
src="images/pos/ofh1.gif"
    alt="ofh1.gif (1964 bytes)" width="100" height="49"></th>
    <th width="100" height="49" valign="top" nowrap><img
src="images/pos/ofh2.gif"
    alt="ofh2.gif (1691 bytes)" width="100" height="49"></th>
    <th width="100" height="49" valign="top" nowrap><img
src="images/pos/ofh3.gif"
    alt="ofh3.gif (1982 bytes)" width="100" height="49"></th>
    <th width="100" height="49" valign="top" nowrap></th>
    <th width="52" valign="bottom" nowrap height="25"
    onMouseover="changeImg('tandh.gif', 'pic1')"
onMouseout="changeImg('im5.gif', 'pic1')"><img
    src="images/pos/tandh.gif" border="1" alt="Firma Information"
name="pic1" width="50"
    height="35"></th>
    <th width="52" height="49" valign="middle" nowrap></th>
    <th width="52" height="49" valign="middle" nowrap></th>
    <th width="25%" height="49" valign="middle" nowrap></th>
  </tr>
  <tr>
    <th width="25%" height="25%" valign="top" nowrap></th>
    <th width="100" height="25%" valign="top" nowrap></th>
    <th width="100" height="25%" valign="top" nowrap></th>
    <th width="100" height="25%" valign="top" nowrap></th>
    <th width="100" height="25%" valign="top" nowrap></th>
    <th width="52" height="25%" valign="top" nowrap></th>
    <th width="52" height="25%" valign="middle" nowrap></th>
    <th width="52" height="25%" valign="middle" nowrap></th>
    <th width="25%" height="25%" valign="middle" nowrap></th>
  </tr>
</table>
</div>
</body>
</html>

--


          \\\\
      o,,,(o o)
      8(o o)(_)Ooo
----ooO--(_)---Ooo--

Bedste hilsner / Best greetings
Kim Larsen

Mail : Webpoint@gmx.net
Homepage : http://get.to/webpoint

Avatar billede klas Juniormester
29. november 1999 - 19:13 #1
he he - - det er sq en del tekst at læse igennem for 30 points :-)
Avatar billede skjoldby Nybegynder
29. november 1999 - 19:23 #2
Du kan ikke lave mouseover i tabeller. Du skal lave de i bilederne ellere rettere sagt ved links. sådan:

<a href="#" onMouseOver="onMouseover="changeImg ('tandh.gif', 'pic1')" onMouseout="changeImg('im5.gif', 'pic1')"><img src="images/pos/tandh.gif" border="1" alt="Firma Information" name="pic1" width="50" height="35"></a>

Hvis du vil have et link istedet skal du bare erstatte # med stien(men det ved du vel).
Avatar billede bjarte Nybegynder
29. november 1999 - 19:40 #3
jeppjepp.....
Avatar billede mccookie Seniormester
29. november 1999 - 20:21 #4
Hejsa

Du kan eventuelt suppeler Skjoldby svar med et lille preload script.

Det virker lidt mere smart når musen bevæges henover !

Håber det er til at forstå:
Det er kogt ned til et absolute minimum
<HTML>
<HEAD>
<meta http-equiv="Expires" content="Wed, 29 september 1999 00:00:00 GMT">
        <TITLE>
OnMouseOver Script med preload</TITLE>



<STYLE></STYLE>
</HEAD>
<BODY>

<SCRIPT LANGUAGE="JAVASCRIPT">

hiddenimg = new Image
hiddenimg.src="2.gif"


</SCRIPT>       

        <A HREF=""
    onMouseOver="document.knap.src=hiddenimg.src;"
    onMouseOut="document.knap.src='1.gif';">
    <IMG NAME="knap" SRC="1.gif" BORDER="0"></A>



</BODY>
</HTML>
Avatar billede skjoldby Nybegynder
29. november 1999 - 21:51 #5
Ja, det er klart. Du mangler squ også at preloade billederne. Godt set mccookie.
Avatar billede kimlarsen Praktikant
30. november 1999 - 16:17 #6
>mccookie.

Perfekt svar. Men det giver et nyt spørgsmål, som bliver stillet i "mouseover - link ?" Så også her kan Du hente 30 point

Kim
Avatar billede skjoldby Nybegynder
30. november 1999 - 19:22 #7
Det var da mig det svarede på selve spørgsmålet. Mccokkie kom bare med et suplement.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester