...

View Full Version : Div position according to specific link



emanuelle
02-17-2009, 10:33 AM
I have a div that needs to open according to the position of a link. The link appears on many pages at different position and the div MUST always open next to it.


<html>
<head>
<title>Untitled</title>
<script>
function showd(element) {
var el = document.getElementById(element);
el.style.display = "block";
}
</script>

<style>.div_watch_commentst_right{position:absolute;left:100px;top:100px;}</style>
</head>
<body>

<div id="myDivcom" style="display:none;border:1px solid red;width:350px;" class="div_watch_commentst_right">text comes here</div>

<a href="#" onClick="showd('myDivcom')" class="link">link1</a>
<br>
<a href="#" onClick="showd('myDivcom')" class="link">link2</a>
</body>
</html>

I want the DIV to ALWAYS open close to its link

abduraooft
02-17-2009, 10:58 AM
http://www.php-development.ru/javascripts/popup-window.php is worth a look!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum