Solved

get click coordinates

Posted on 2003-12-11
2
1,063 Views
Last Modified: 2008-03-17
i want to popup a <select> list when the user clicks an <a> link at the (x,y) position he clicks.  does a javascript have access to the coordinates of the input click?
0
Comment
Question by:blpotter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 16

Accepted Solution

by:
jaysolomon earned 125 total points
ID: 9921489
this want get the coords, but will display a select underneath the link

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
function toggle(obj){
      var objID = document.getElementById(obj);
            objID.style.display = (objID.style.display == "none")?"":"none";
}
// -->
</script>
<style type="text/css">
<!--
div#links {
      position: absolute;
      top: 81px;
      left: 0px;
      width: 166px;
      height: 700px;
      font: 16px Verdana, sans-serif;
      z-index: 100;
}
div#links a {
      display: block;
      text-align: center;
      font: bold 1em sans-serif;
         padding: 5px 10px;
      margin: 0px 0px 1px;
      border-width: 0px;
         text-decoration: none;
      color: #b7b7b7;
      background: #184785;         
      border-right: 5px solid #426eb4;
}
div#links a:hover {
      color: #411;
      background: #426eb4;
         border-right: 5px double #184785;
}
div#links span {
      
         position: relative;
      width: 125px;
         padding: 5px;
      z-index: 100;
         color: #411;
      background: transparent;
         font: 10px Verdana, sans-serif;
      text-align: center;
}
-->
</style>
</head>
<body>
<div id="links">
<a href="#" onclick="toggle('sel');return false;">Select1<span id="sel" style="display: none;"><form name="form1"><select name="sel1"><option>Option1</option><option>Option2</option></select></span></a>
<a href="#" onclick="toggle('sel2');return false;">Select2<span id="sel2" style="display: none;"><form name="form2"><select name="sel2"><option>Option1</option><option>Option2</option></select></span></a>
<a href="#" onclick="toggle('sel3');return false;">Select3<span id="sel3" style="display: none;"><form name="form3"><select name="sel3"><option>Option1</option><option>Option2</option></select></span></a>
</div>
</body>
</html>
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9921892
Glad to have helped Thanks

jAy
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question