Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Div position according to specific link

    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

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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