View Single Post
  #5 (permalink)  
Old March 1st, 2007, 04:05 PM
schoolBoy schoolBoy is offline
Authorized User
 
Join Date: Mar 2007
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok I couldnt find a function for the second time I would use onClick.
So I made a new function with a Boolean:

function clickImg(img)
    {
        var geklikt = false

        if(geklikt == false)
        {
        img.setAttribute('width','400px');
        img.setAttribute('height','400px');
        geklikt = true
        //alert("hooi")
                break;
        }

        if(geklikt)
        {
        img.setAttribute('width','200px');
          img.setAttribute('height','200px');
        geklikt = false
        }
    }

The problem is that he excecutes the whole code. So he makes the picture large and small again so quick you dont even see it ( you can see it when I use the alert ).

So I thought I should use a break at the point where the alert is now. But that doesnt work.

Can it be that " var geklikt = false " means that the var gets false everytime the function starts ?

I guess you know what i'm trying to create but i'm really new into this and I cant get it working so if you know a solution please help.

Thnx for reading again :)