Results 1 to 2 of 2

Thread: Floating Top Bar script to stay within its own div

  1. #1
    Join Date
    Jan 2009
    Location
    Lowell
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Floating Top Bar script to stay within its own div

    1) Script Title: Floating Top Bar script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/floatbar.htm

    3) Describe problem: I really do love this script. What I am trying to accomplish is taking this script and placing it into a div instead of the body of the page.

    Example: Say I have a header about 400 pixels in height. Right after the header I have a new div, and contained in that div is the floating bar. So when I scroll down I want my five pixels from the top to be within that div.

    If I am not making sense please let me know.

    Thank you

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    That should be just fine. All you need to do is make sure the div containing the bar is positioned:
    Code:
    #wrap {
    	position: relative;
    }
    HTML Code:
    <div id="wrap">
    	<div id="topbar">
    		Your content here.
    	</div>
    </div>
    Good luck!

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
  •