Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    May 2004
    Posts
    4
    Member #
    6076
    Hi - Newbie alert!

    I'm having big problems trying to get a DIV layer to position in the place I want it to. At the moment when I click on an image I want the layer to show up in a particular place on the page. I am using the style option of the DIV thus:

    style="position:absolute;left:42px;top:20px;width: 520px; height:318px; background-color:#000000; layer-background-color:#000000; visibility:hidden;"

    The problem with this is the layer pops up 42px from the very top of the page and NOT 42px from the top of the page when scrolled down to the section I am at when I click for the layer to show.

    This is an utter nightmare and I can't sort it

  2.  

  3. #2
    Senior Member Fallout's Avatar
    Join Date
    Aug 2003
    Location
    Richmond, Virginia
    Posts
    543
    Member #
    2748
    Position: absolute will always go from the top of the page - not the top of whatever viewing area is currently onscreen. Without a link to your site or anything, its hard to help much more.

  4. #3
    Junior Member
    Join Date
    May 2004
    Posts
    4
    Member #
    6076
    http://garfielduk.dnsalias.net/showme1.html

    Basically when i click on the first "Show Me" button i want the layer (which is at the moment just black) to pop up on the page in the same place no matter where the user is scrolled to.


  5. #4
    Senior Member Fallout's Avatar
    Join Date
    Aug 2003
    Location
    Richmond, Virginia
    Posts
    543
    Member #
    2748
    Instead of putting the div first thing in the <body> tag, try putting it right below or above the button (assuming thats where you want it to appear).

  6. #5
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    position:absolute will not achive the results you are looking for.. However position:fixed does, sorta. In Most browsers, it does what you want it to do very nicely. It will position itself according to the viewport. However in IE you have to use some javascript to get it to do this. For a more in-depth explination see my css positioning tutorial.

    That reminds me.. I need to find some time so I can finish writing part two and three.


  7. #6
    Junior Member
    Join Date
    May 2004
    Posts
    4
    Member #
    6076
    That's great thanks :classic: :alien: :bandit:


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:40 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com