Avatar billede reino Nybegynder
21. november 2006 - 09:06 Der er 1 kommentar og
1 løsning

Mouseoverproblem i Firefox

Hejsa og hjælp hjælp :)

har modtaget nedenstående kode, det er en mouseover funktion, virker fint i IE men desværre ikke i Mozilla Firefox.
Noget der er meget omstændigt eller ? Gode point gives da jeg simpelthen ikke lige kan gennemskue det.

<div id="spacer0" style="position: absolute; top: 0; left: 326; width: 1; height: 400; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="400" width="1" border="0"></div>
    <div id="spacer1" style="position: absolute; top: 0; left: 326; width: 400; height: 1; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="1" width="400" border="0"></div>
   
    <div id="spacer2" style="position: absolute; top: 0; left: 426; width: 1; height: 400; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="400" width="1" border="0"></div>
    <div id="spacer3" style="position: absolute; top: 100; left: 326; width: 400; height: 1; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="1" width="400" border="0"></div>
   
    <div id="spacer4" style="position: absolute; top: 0; left: 526; width: 1; height: 400; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="400" width="1" border="0"></div>
    <div id="spacer5" style="position: absolute; top: 200; left: 326; width: 400; height: 1; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="1" width="400" border="0"></div>
   
    <div id="spacer6" style="position: absolute; top: 0; left: 626; width: 1; height: 400; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="400" width="1" border="0"></div>
    <div id="spacer7" style="position: absolute; top: 300; left: 326; width: 400; height: 1; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="1" width="400" border="0"></div>
   
    <div id="spacer8" style="position: absolute; top: 0; left: 726; width: 1; height: 400; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="400" width="1" border="0"></div>
    <div id="spacer9" style="position: absolute; top: 400; left: 326; width: 400; height: 1; z-index: 1; background-color: #000000;"><img src="/billeder/black.gif" height="1" width="400" border="0"></div>
   
<script language="JavaScript1.2" src="/includes/global.js"></script>
<script language="JavaScript1.2">

var mode = new Array(16);
mode[0] = true;
mode[1] = true;
mode[2] = true;
mode[3] = true;
mode[4] = true;
mode[5] = true;
mode[6] = true;
mode[7] = true;
mode[8] = true;
mode[9] = true;
mode[10] = true;
mode[11] = true;
mode[12] = true;
mode[13] = true;
mode[14] = true;
mode[15] = true;


var timers = new Array(16);
for(i=0;i<16;i++)
    timers[i]=0;

function maxCounter()
{
    var rank = 0;
   
    for (var t=0;t<16;t++)
    {
        rank = Math.max(rank,timers[t]);
    }

    if(isNaN(rank))
    {
        rank = -1;
    }
   
    return rank;
}

function Toggle()
{

    for(var i=0;i<16;i++)
    {
        if(timers[i]==1)
            {
                hideLayer("content"+i);
                i = 16;
            }
    }

    for(var i=0;i<16;i++)
    {
        timers[i]-=1;
    }
   
    setTimeout("Toggle();",1000);
}

Toggle();

function mouse_on(i)
{
    //timers[i] = 0;
    if (mode[i])
        {
            //document.all["content"+i].style.visibility = "visible";
            showLayer("content"+i);
        }
    if(layerExists("info"+i))
        {
            if(layerExists("captionLayer"))
                hideLayer("captionLayer");
            //document.all["info"+i].style.visibility = "visible";
            showLayer("info"+i);
        }
   
}

function mouse_out(i)
{
    if(mode[i])
    {
        if (timers[i]<1) timers[i] = maxCounter()+1;
    }
    if(layerExists("info"+i))
        {
            if(layerExists("captionLayer"))
                showLayer("captionLayer");
            //document.all["info"+i].style.visibility = "hidden";
            hideLayer("info"+i);
        }
}

</script>

        <div id="mousecatcher0" style="position: absolute; top: 1; left: 327; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Virksomhed" onMouseOver="mouse_on(0);" onMouseOut="mouse_out(0);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content0" style="position: absolute; top: 1; left: 327; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">virksomheds-<br>profil</font></td></tr></table></div>
        <div id="mousecatcher1" style="position: absolute; top: 1; left: 427; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Priser" onMouseOver="mouse_on(1);" onMouseOut="mouse_out(1);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content1" style="position: absolute; top: 1; left: 427; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">priser og<br>anerkendelser</font></td></tr></table></div>
        <div id="mousecatcher2" style="position: absolute; top: 1; left: 527; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Nyheder" onMouseOver="mouse_on(2);" onMouseOut="mouse_out(2);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content2" style="position: absolute; top: 1; left: 527; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">nyheder</font></td></tr></table></div>
        <div id="mousecatcher3" style="position: absolute; top: 1; left: 627; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Konkurrencer" onMouseOver="mouse_on(3);" onMouseOut="mouse_out(3);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content3" style="position: absolute; top: 1; left: 627; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">deltagelse i konkurrencer</font></td></tr></table></div>
        <div id="mousecatcher4" style="position: absolute; top: 101; left: 327; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Igang" onMouseOver="mouse_on(4);" onMouseOut="mouse_out(4);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content4" style="position: absolute; top: 101; left: 327; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">igangværende<br>arbejder</font></td></tr></table></div>
        <div id="mousecatcher5" style="position: absolute; top: 101; left: 427; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Bolig" onMouseOver="mouse_on(5);" onMouseOut="mouse_out(5);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content5" style="position: absolute; top: 101; left: 427; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">boligbyggerier</font></td></tr></table></div>
        <div id="mousecatcher6" style="position: absolute; top: 101; left: 527; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Bybygning" onMouseOver="mouse_on(6);" onMouseOut="mouse_out(6);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content6" style="position: absolute; top: 101; left: 527; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">bybygning og landskab</font></td></tr></table></div>
        <div id="mousecatcher7" style="position: absolute; top: 101; left: 627; width: 99; height: 99; z-index: 30;" ><a href="#" onMouseOver="mouse_on(7);" onMouseOut="mouse_out(7);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content7" style="position: absolute; top: 101; left: 627; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">&nbsp;</font></td></tr></table></div>
        <div id="mousecatcher8" style="position: absolute; top: 201; left: 327; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Kontor" onMouseOver="mouse_on(8);" onMouseOut="mouse_out(8);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content8" style="position: absolute; top: 201; left: 327; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">kontor- og<br>erhvervsbyggerier</font></td></tr></table></div>
        <div id="mousecatcher9" style="position: absolute; top: 201; left: 427; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Samlet" onMouseOver="mouse_on(9);" onMouseOut="mouse_out(9);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content9" style="position: absolute; top: 201; left: 427; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">samlet<br>produktion</font></td></tr></table></div>
        <div id="mousecatcher10" style="position: absolute; top: 201; left: 527; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Institution" onMouseOver="mouse_on(10);" onMouseOut="mouse_out(10);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content10" style="position: absolute; top: 201; left: 527; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">institutions-<br>byggerier</font></td></tr></table></div>
        <div id="mousecatcher11" style="position: absolute; top: 201; left: 627; width: 99; height: 99; z-index: 30;" ><a href="#" onMouseOver="mouse_on(11);" onMouseOut="mouse_out(11);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content11" style="position: absolute; top: 201; left: 627; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">&nbsp;</font></td></tr></table></div>
        <div id="mousecatcher12" style="position: absolute; top: 301; left: 327; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Medarbejdere" onMouseOver="mouse_on(12);" onMouseOut="mouse_out(12);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content12" style="position: absolute; top: 301; left: 327; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">medarbejdere</font></td></tr></table></div>
        <div id="mousecatcher13" style="position: absolute; top: 301; left: 427; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=Udlandet" onMouseOver="mouse_on(13);" onMouseOut="mouse_out(13);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content13" style="position: absolute; top: 301; left: 427; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">projekter i udlandet</font></td></tr></table></div>
        <div id="mousecatcher14" style="position: absolute; top: 301; left: 527; width: 99; height: 99; z-index: 30;" ><a href="/show/niveau2.asp?page=English" onMouseOver="mouse_on(14);" onMouseOut="mouse_out(14);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content14" style="position: absolute; top: 301; left: 527; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">english<br>summary</font></td></tr></table></div>
        <div id="mousecatcher15" style="position: absolute; top: 301; left: 627; width: 99; height: 99; z-index: 30;" ><a href="#" onMouseOver="mouse_on(15);" onMouseOut="mouse_out(15);" onClick=""><img name="image" src="/billeder/spacer.gif" border="0" height="99" width="99"></a></div>
        <div id="content15" style="position: absolute; top: 301; left: 627; width: 99; height: 99; z-index: 2; background-color: #000000; visibility: hidden;"><table width="99" height="99" cellspacing="0" cellpadding="0" border="0" background="/billeder/black.gif"><tr><td align="center" valign="top" class="contents"><font color="#FFFFFF">&nbsp;</font></td></tr></table></div>
<div id="background"
  style="position: absolute;
  top: 0;
  left:326;
  width: 400;
  height: 400;
  z-index: 0;"><img src="/billeder/hovedmotiv.jpg" width="400" height="400" alt="" border="0">
</div>
Avatar billede olebole Juniormester
21. november 2006 - 13:48 #1
<ole>

Hele koden (både HTML og JavaScript) er IE-only kode. Det skal skrives om fra bunden, hvis det skal virke i andre browsere - og det kan vist ikke betale sig. Prøv at finde en anden kode, der er nogenlunde valid og virker  =)

/mvh
</bole>
Avatar billede reino Nybegynder
17. marts 2007 - 12:08 #2
oki, tak, lukker og slukker
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
Vi tilbyder markedets bedste kurser inden for webudvikling

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