Im trying to capture every X and Y Co-ordinate of a page.
Is there some kind of function of special tag that I culd learn so that when I run my mouse over any section of a page, an X and Y co-ordinate is given??
<INPUT class="clickablearea" TYPE = "Submit" VALUE ="Enter">
<INPUT class="clickablearea" TYPE = "Reset" VALUE ="Clear">
jared@aauser.com
Thanx for all your previous help, I have one more Question (Which is hopefully my last ),
The code works well i.e. I can click anywhere on the page and 1 pair of co-ordinates are captured succesfusly.
Using these co-ordinates, I can display a variable on an action page (page 2) anywhere I want.
Is there a way of defining multiple areas as clickable
i.e. on page 1 I can select a clickable area and the values of X and Y are captured in 1 input box, and then capture another clickable area for a second input box on that same page so that on my action page (page 2) I can position two variables given by the TWO pair of XY cordinates captured on page 1?
I hope this makes sense?
Once again, Your help is greatly appreciated
AFter all the improvements you suggested, here is what the code look like:
<style>
.clickablearea{cursor:hand;}
</style>
</head>
<body>
<script>
function mouseMoved()
{
var eobj,thex,they
eobj = window.event
if(eobj.srcElement.className!="clickablearea"
{
thex = eobj.clientX
they = eobj.clientY
document.formname2.y.value=thex
document.formname2.x.value=they
}
<class="clickablearea">This line is clickable
The X Co-Ordinate is <input type="text" name=x Value=0><BR>
The Y Co-Ordinate is <input type="text" name=y Value=0>
<INPUT class="clickablearea" TYPE = "Submit" VALUE ="Enter">
<INPUT class="clickablearea" TYPE = "Reset" VALUE ="Clear">
</FORM>
</body>
</html>
(For some reason, I do not need the Div tags? and it works fine)
Hi Jaredn,
Thanx for the tip, but I dont have a foggiest of how to go about it? I am a complete complete novice when it comes to programming and especially Javascript.
Could you maybe provide an example?
Dear ma701sa, I hate to sound offensive, but you should really try to read at least ONE book on JavaScript before flooding this list with such kind of questions. Imagine you go to Math group and start asking how to solve x^2+x+1=0 and then demanding explanations on why solution is two complex numbers . ---
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.