Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005
    UK, London

    Dynamic contents box

    I found this code from website im now trying to use it in my website

    this is the java script part that goes between <head></head> tag

    <script type="text/javascript">
    function getposOffset(overlay, offsettype){
    var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
    var parentEl=overlay.offsetParent;
    while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    return totaloffset;
    function overlay(curobj, subobj){
    if (document.getElementById){
    var subobj=document.getElementById(subobj), "left")+"px", "top")+"px""block"
    return false
    return true
    function overlayclose(subobj){
    to show the dynamic box, i have to link like this

    <a href="#" onClick="return overlay(this, 'subcontent')">Open Box</a>

    and the dynamic box it self is done like this:

    <DIV id="subcontent1" style="position:absolute; display:none">
    // A table here
    Everything works! but i just want a slight adjustment to the code. when i click on the link to open the box, it opens in the wrong area.

    For e.g. i click on the 'link' to open the box like this:

    when the box opens, it opens in the wrong area like this:

    What i want is to open like this:

    How do you do this????

  2. #2
    Join Date
    Aug 2005

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts