Platform target - android 4.0 and above.
Environment - html5+css3+javascript using phonegap
In my app under above environment, I want a popup menu which is nothing but a <div>
, to appear, exactly few pixels above a button's top when user touches it. Till now I've worked out upto this:
<head>
<script type="text/javascript" charset="utf-8">
var touchme=document.getElementById('#button');
function onDeviceReady(){
touchme.addEventListener('touchstart',onNav, false);
}
function onNav() {
popup=document.querySelector("#divPop");
popup.style.display="block"; //this will make a popup appear
touchme.getBoundingClientRect();
navigator.notification.alert(touchme.top);
}
</script>
</head>
Now problem is, even alert is not showing up. So how would I get the co-ordinates of the button?