J
johkar
I want to position an absolutely positioned div 75px above the button
clicked on. The following is what I have so far, but as you can tell
it needs more work. I want it positioned in relationship to the button
within the window, not the entire screen...and scrolling the window
shouldn't effect it. Just need some pointers please.
<script type="text/javascript">
function showEmployee(elm,x,y){
if(document.getElementById('awardDiv')){
var myElm=document.getElementById('awardDiv');
myElm.style.display='block';
myElm.style.left=(x - myElm.clientWidth/2) +'px';
myElm.style.top=(y + 25) +'px';
}
}
</script>
<input type="button" name="myButton" value="Select Another Employee"
onclick="showEmployee(this,event.clientX,event.clientY)">
clicked on. The following is what I have so far, but as you can tell
it needs more work. I want it positioned in relationship to the button
within the window, not the entire screen...and scrolling the window
shouldn't effect it. Just need some pointers please.
<script type="text/javascript">
function showEmployee(elm,x,y){
if(document.getElementById('awardDiv')){
var myElm=document.getElementById('awardDiv');
myElm.style.display='block';
myElm.style.left=(x - myElm.clientWidth/2) +'px';
myElm.style.top=(y + 25) +'px';
}
}
</script>
<input type="button" name="myButton" value="Select Another Employee"
onclick="showEmployee(this,event.clientX,event.clientY)">