Results 1 to 3 of 3

Thread: positioning in Scroll to Top Control

  1. #1
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default positioning in Scroll to Top Control

    1) Script Title: Scroll to Top Control Script

    2) Script URL (on DD):

    http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm

    3) Describe problem:

    The script uses fixed positioning to place the link/image relative to the browser window. Is there a way to place it relative to a containing div? In my case, I wish to contain this link inside the layout border, so if user expands browser window horizontally the link won't go beyond the 'wrapper' div.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The script does let you create any arbitrary image link on the page and have it scroll the page to the top when clicked on, for example:

    Code:
    <a href="#top"><img src="up.gif" /></a>
    Does that help, or do you also need this custom image to behave just like the fixed position image which fades/ hide as the page is scrolled?
    DD Admin

  3. #3
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    My issue isn't about using a custom image....I get how to do that. I'm talking about how the script places the link, be it HTML or image, relative to the browser window. As a result, when this link becomes visible the user can easily cause the link to move outside of the wrapper DIV if he/she widens the browser window horizontally to a large degree. I want this link to be contained INSIDE of the wrapper DIV no matter how wide the user's browser window is.

    Again, the default state of the script places the link based on the browser window. So if I set the variables as such:

    Code:
    controlattrs: {offsetx:150, offsety:145}
    These coordinates are relative to the right/bottom of the browser window corner. I'd like them to be relative to the right/bottom of a DIV, ex: a wrapper div that is centered in the browser window, so the link is contained within that div.

    I hope that makes more sense.

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
  •