How to execute a function and send the ID that initiated the event?
Hi all.
I have a function in which I manually send an argument which is the name of the ID calling on the function
For example (this is placed in a simple onmouseover event within the DIV:
- rw_moveToTarget("The_ID_of_This_Div")
And then the function looks like this:
- function rw_moveToTarget(DivTargetPassed){
- var testVar = $("div[id*="+DivTargetPassed+"]");
- var targetPosition = testVar.position();
- var leftPosition = targetPosition.left;
- var topPosition = targetPosition.top;
- }
The above works fine for my current needs but in order to make it more dynamic I want to remove the hardcoded argument value of the DIV ID by allowing the function to KNOW who is calling on it.
Do you have any suggestions?
I see things like event.target and tried it but didnt have success.
Thanks for your help :)
RW