Results 1 to 3 of 3

Thread: Floating Submit button

  1. #1
    Join Date
    Apr 2007
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Floating Submit button

    I have table that displays data pulled from a database for updating/changing and it can be quite long.
    The submit button is at the bottom of the page but I was wondering if I could get the button to 'float' alongside the table as the user scrolls down/up the page.

    That way they don't have to scroll all the way down if only entering data at the top.

    Thanks

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Something like:
    <button style="position:fixed;right:2px;top:2px;_position:absolute;_top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop+screen.height*0.002 : document.body.scrollTop+screen.height*0.002)">bla</button>

    The underscore values are only read by IE, and simulate the fixed position that IE<7 doesn't have. If you don't like hacking, you can use conditional statements.

    Arie Molendijk.

  3. #3
    Join Date
    Apr 2007
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Works nicely thanks.
    I put it into a table cell so that it is positioned correctly across the page if the table width changes. Also took out the right:200px as it made the button stretch across the whole page.

    Many thanks.

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
  •