I'm not a programmer, I'm just a web designer with a bit of programming skills, and I ask you to help me learn a little more about jquery / javascript.
I have one function that calls 2 different divs (test1 and test2)
myFunction ($("#test1"));
myFunction ($("#test2"));
I want to try to achieve something similar to
myFunction ($("#test1") $("#test2"));
Because I want to try to use one call to call multiple divs. Also, my problem is that my ipotetical myFunction should look like this:
myFunction (param1, param2){ if(typeof param2 == "undefined"){param2 = $(window)};
I have no idea how to create a multiple function call to perform the same action, but for different elements, and with the fact that I can have several parameters, this does not make it easier for me.
Any suggestion on how to do this? or some resource on which I could read? thanks in advance!:)