Results 1 to 4 of 4

Thread: Drop-in content box - Absolute Positioning

  1. #1
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drop-in content box - Absolute Positioning

    Hi all,
    I am a new to the forums and had a question about the Drop-in content box. I am currently using this on a website and am very happy with the results, however, I am having trouble controling the absolute positioning.

    The content box contains an inline style that sets the left and top position. The left works fine the the top doesn't work for me. The only way I can modify the top position is to change the actual javascript and even then I can't get it down to an exact pixel.

    The question is
    Is there a way to control the absolute top and left positioning of the content box using just css.

    Thanks in advance.
    Ludy

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Short answer: No.

    I've used this script, highly modified, on a site I master. I recall that the vertical position was difficult to get exact and that it required editing the script. I'm not sure I ever got it exact rather, I recall getting it about where I wanted it vertically. Things get even more complicated when the page you are dropping down over is displayed at various resolutions. Bear in mind that this is a drop down box, meant to cover other content and thrust itself into the user's attention. It also can be dismissed to render the content underneath it visible once again.

    Added Later:

    This is where the 'action' is as far as the vertical position goes:
    Code:
    function dropin(){
    scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
    if (parseInt(crossobj.top)<100+scroll_top)
    crossobj.top=parseInt(crossobj.top)+40+calunits
    else{
    clearInterval(dropstart)
    bouncestart=setInterval("bouncein()",50)
    }
    }
    Let's take a look at those two red lines:
    Code:
    if (parseInt(crossobj.top)<100+scroll_top)
    crossobj.top=parseInt(crossobj.top)+40+calunits
    100 is a limit. Once the box is 100px from the top, dropping stops. 40 is an increment. It is the number of pixels the box drops at a time. By making the increment smaller and adjusting the limit, you can achieve a fairly exact final vertical position for the top of the box.
    Last edited by jscheuer1; 06-16-2005 at 06:37 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your help. I was able to get the content box where I wanted it by changing the value on "40+calunits". Thanks Again

  4. #4
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can I drop down the menu box on Exit??

    Hi. How can I change the script so the menu drops down on exit instead of onload AND make sure it closes when a surfer clicks on a link inside it??

    Thank you for your time.

    Dave
    Las Vegas

Bookmarks

Posting Permissions

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