[JS] Onmouseover naar zelfde functie...

Pagina: 1
Acties:

  • Optix
  • Registratie: Maart 2005
  • Laatst online: 19-11 11:46
Ja titel is beetje verwarrend he :P

Maar het zit zo:
JavaScript:
1
2
3
4
5
6
    function switchImage(obj_id, newImg)
    {
        var html_obj = document.getElementById(obj_id);
        html_obj.onmouseout = switchImage(html_obj.id,html_obj.src);
        html_obj.src = newImg;
    }


Dat vindt de browser niet zo fijn::
code:
1
Fout too much recursion


Wat doe ik fout :?

In GoT search en google vindt ik zoiets wel, maar die verwijst dan naar een funtie zonder parameters

.


  • newpegasus
  • Registratie: Juni 2003
  • Laatst online: 13-03-2022

newpegasus

Hertog

Je geeft geen conditie aan wanneer de recursie zou moeten stoppen :P.

Oneindige lus dus.

GuitarFacts | Last.fm | Google Zoekmachine Optimalisatie


  • Optix
  • Registratie: Maart 2005
  • Laatst online: 19-11 11:46
Hmm, tr00, (te) lange week gehad :P

Lock em anders maar :)

[ Voor 27% gewijzigd door Optix op 10-11-2006 15:42 ]

.


  • crisp
  • Registratie: Februari 2000
  • Nu online

crisp

Devver

Pixelated

JavaScript:
1
html_obj.onmouseout = function() { switchImage(html_obj.id,html_obj.src); }

Intentionally left blank