If I do the following:
image[i].onmousedown = whatever;
It will work perfectly fine and run the whatever() function on click. However if I do the following:
image[i].onmousedown = whatever( name, what, when, where, how );
It will run the function when it assigns the property. Let's say I create 30 images and want to give them all onmousedown functions, it will run that function 30 times on load just because I added the () after whatever. But how else do I assign my functions the properties I want?
Is the only way to make a function run the function? So do something like
image[i].onmousedown = whatever;
function whatever() {
anotherWhatever( this, name, what, when, where, how );
}
I also have to assign a new value to 'this' it seems? What would you guys suggest or please tell me you have a better way of doing it. Thanks in advance for any help