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
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fixed button clickable to top of page

    I have figured out how to fix a button so it stays in bottome left hand corner even if you scroll on the page, but I can not get it to activate so when it is clicked it will take you to top of page. Can anyone help please? I can get to top of page using standard <a name="....."> tag. I have enclosed

    <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html lang = "EN" dir = ltr" xmlns = "http://www.w3.org/1999/xhtml">

    <head>
    <meta http-equiv = "content-type" content = "text/xml;
    charset = utf-8" />
    <title>Stationary buttons</title>
    </head>

    <body>

    <!--opening tag for top of page jump-->
    <a name = "top"></a>

    <!--Code fixes a bottom in the bottom left hand corner but I can not
    get it to activate to send to top of page-->
    <input type="button";
    name = "button";
    style="position:fixed;
    bottom:0; left:0;"
    value="Top">
    <P> Trying to add a stationary button which does not move when you
    scroll the page.llllllllllllllllllllllll llllllllllllllllllllll llllllllllllllllllllllllllll llllllllllllllllllllllll lllllllllllllllllllll
    llllllllllllllll llllllllllllllllllll lllllllllllllllllllllllllll lllllllllllllllll lllllllllll lllll lllllllllllllllll lllllllllllllll llllllllllllll
    lllllllllllllllllll lllllllllllllllllllll lllll llllll lllllllllllllllllllllllllllllllllll lllllllllllllllllll lllllllll llllllllllll llllllllllllllll
    llllllllllllllllllll llllllllllllllllllllllllll lllllll l lllllllllllllllll lll lllllllllllllllllllllllll l lllllllllllllllllllllllllllllll llllllllll
    lllllllllllllllllllllllllll lllllllllllllllllllllll llllllllllllllllllllll llllllllllllllll lllllllllllllllll llllllllllllllll llllllllllllllll lllllll
    lllllllllllllllllllllllllllll llllllllllllllllllllllll llllllllllllllllll lllllllllllllllllllllllllllll</p>
    <P> Trying to add a stationary button which does not move when you
    scroll the page.llllllllllllllllllllllll llllllllllllllllllllll llllllllllllllllllllllllllll llllllllllllllllllllllll lllllllllllllllllllll
    llllllllllllllll llllllllllllllllllll lllllllllllllllllllllllllll lllllllllllllllll lllllllllll lllll lllllllllllllllll lllllllllllllll llllllllllllll
    lllllllllllllllllll lllllllllllllllllllll lllll llllll lllllllllllllllllllllllllllllllllll lllllllllllllllllll lllllllll llllllllllll llllllllllllllll
    llllllllllllllllllll llllllllllllllllllllllllll lllllll l lllllllllllllllll lll lllllllllllllllllllllllll l lllllllllllllllllllllllllllllll llllllllll
    lllllllllllllllllllllllllll lllllllllllllllllllllll llllllllllllllllllllll llllllllllllllll lllllllllllllllll llllllllllllllll llllllllllllllll lllllll
    lllllllllllllllllllllllllllll llllllllllllllllllllllll llllllllllllllllll lllllllllllllllllllllllllllll</p>
    <P> Trying to add a stationary button which does not move when you
    scroll the page.llllllllllllllllllllllll llllllllllllllllllllll llllllllllllllllllllllllllll llllllllllllllllllllllll lllllllllllllllllllll
    llllllllllllllll llllllllllllllllllll lllllllllllllllllllllllllll lllllllllllllllll lllllllllll lllll lllllllllllllllll lllllllllllllll llllllllllllll
    lllllllllllllllllll lllllllllllllllllllll lllll llllll lllllllllllllllllllllllllllllllllll lllllllllllllllllll lllllllll llllllllllll llllllllllllllll
    llllllllllllllllllll llllllllllllllllllllllllll lllllll l lllllllllllllllll lll lllllllllllllllllllllllll l lllllllllllllllllllllllllllllll llllllllll
    lllllllllllllllllllllllllll lllllllllllllllllllllll llllllllllllllllllllll llllllllllllllll lllllllllllllllll llllllllllllllll llllllllllllllll lllllll
    lllllllllllllllllllllllllllll llllllllllllllllllllllll llllllllllllllllll lllllllllllllllllllllllllllll</p>
    <P> Trying to add a stationary button which does not move when you
    scroll the page.llllllllllllllllllllllll llllllllllllllllllllll llllllllllllllllllllllllllll llllllllllllllllllllllll lllllllllllllllllllll
    llllllllllllllll llllllllllllllllllll lllllllllllllllllllllllllll lllllllllllllllll lllllllllll lllll lllllllllllllllll lllllllllllllll llllllllllllll
    lllllllllllllllllll lllllllllllllllllllll lllll llllll lllllllllllllllllllllllllllllllllll lllllllllllllllllll lllllllll llllllllllll llllllllllllllll
    llllllllllllllllllll llllllllllllllllllllllllll lllllll l lllllllllllllllll lll lllllllllllllllllllllllll l lllllllllllllllllllllllllllllll llllllllll
    lllllllllllllllllllllllllll lllllllllllllllllllllll llllllllllllllllllllll llllllllllllllll lllllllllllllllll llllllllllllllll llllllllllllllll lllllll
    lllllllllllllllllllllllllllll llllllllllllllllllllllll llllllllllllllllll lllllllllllllllllllllllllllll</p>
    <P> Trying to add a stationary button which does not move when you
    scroll the page.llllllllllllllllllllllll llllllllllllllllllllll llllllllllllllllllllllllllll llllllllllllllllllllllll lllllllllllllllllllll
    llllllllllllllll llllllllllllllllllll lllllllllllllllllllllllllll lllllllllllllllll lllllllllll lllll lllllllllllllllll lllllllllllllll llllllllllllll
    lllllllllllllllllll lllllllllllllllllllll lllll llllll lllllllllllllllllllllllllllllllllll lllllllllllllllllll lllllllll llllllllllll llllllllllllllll
    llllllllllllllllllll llllllllllllllllllllllllll lllllll l lllllllllllllllll lll lllllllllllllllllllllllll l lllllllllllllllllllllllllllllll llllllllll
    lllllllllllllllllllllllllll lllllllllllllllllllllll llllllllllllllllllllll llllllllllllllll lllllllllllllllll llllllllllllllll llllllllllllllll lllllll
    lllllllllllllllllllllllllllll llllllllllllllllllllllll llllllllllllllllll lllllllllllllllllllllllllllll</p>

    <!--closing tag for top of page jump-->
    <a href = "#top">TOP</a>

    </body>
    </html>

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    In the case of wanting to get explicitly to the very top of the page all you need to do is make the href value point to "#" like so:

    Code:
    <a href="#">TOP</a>
    You can then get rid of this anchor entirely:
    Code:
    <!--opening tag for top of page jump-->
    <a name = "top"></a>
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


  •  

    Posting Permissions

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