View Full Version : Div position according to specific link

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.

function showd(element) {
var el = document.getElementById(element);
el.style.display = "block";


<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>
<a href="#" onClick="showd('myDivcom')" class="link">link2</a>

I want the DIV to ALWAYS open close to its link

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