Hi ddadmin,
in your post, you provided the solution using id=test with this code:
Code:
<p id="test">
This is some textThis is some textThis is some textThis is some textThis is some textThis is some text
</p>
<!-- 1) DHTML Window Example 1: -->
<script type="text/javascript">
var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://images.google.com/", "#1: Google Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")
dhtmlwindow.getposOffset=function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
var anchorelement=document.getElementById("test")
googlewin.moveTo(dhtmlwindow.getposOffset(anchorelement, "left"), dhtmlwindow.getposOffset(anchorelement, "top"))
</script>
I tried it and it works great.
Can you please advice how to change the code so that it will work with the following version of popups i use:
Code:
<a href="#" onClick="divwin=dhtmlwindow.open('divbox', 'div', first_popup, 'Free spirit', 'width=620px,height=155px,left=52px,top=462px,resize=0,scrolling=0'); return false"></a><br><br>
<a href="#" onClick="divwin=dhtmlwindow.open('divbox', 'div', second_popup, 'Free spirit2', 'width=620px,height=155px,left=52px,top=462px,resize=0,scrolling=0'); return false"></a>
Thanks in advance
Foundas
Bookmarks