I am not that great with javascript but I've been trying to create a little script that automatically clicks a certain position on the window.
I am not 100% sure how to do this. Can someone please help.
What I want it to be able to do is find out where the position of the mouse currently is (this part I already know how to do) and then click those coordinates)
I know you can use javascript click a link by doing
document.getElementById('linkID').click();
so maybe there is a way to use this to click a perticular coordinate?
"Unfortunately, thats not what I need to do. I need this function to be triggered automatically not by the user having to click on the page".
Your first post, though, had this line....
Originally Posted by majma
"What I want it to be able to do is find out where the position of the mouse currently is
(this part I already know how to do) and then click those coordinates ".
It appears that you have now decided to move the goalposts.
It simply is not possible to force click in the way you want. All you can do is simulate.
First of all, you would need to pick the coordinate where the click will be. Second, you would need to FIND which is the first element UNDER those coordinates so that then you can invoke that elements click() function.
That is one hell of a job if you ask me. You'd have to do tremendous calculations and storage of elements positions relative to the page's X and Y, plus the elements dimensions AND its z-index.
Bookmarks