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 7 of 7
  1. #1
    New Coder
    Join Date
    Oct 2004
    Location
    Sydney
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    event OnClick sends user to Top Of Page

    A finishing touch on a page.

    I have a pop up with CALCULATE button. The page content is longer than the height of the pop up window. Therefore when the user clicks on CALCULATE the page is refreshed and goes to the top of the page.

    The issue for me is that when the user calculates they have to scroll back to the bottom of the page to see the results.

    Q) How do I maintain the page's horizontal position onClick? Or (even better) have the page sent to the bottom of the page onClick not the top.

    http://www.finser.com.au/content/calculators.php
    Then click Retirement Calculator…
    Then click Case A

    (it’s a process (sorry))

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    u can try something like this
    Code:
    onclick="window.scrollTo(0,screen.height)"

  • #3
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Code:
    onClick="MM_swapImage('calc','','btn_c_Calc.gif',1);MM_callJS('superCalcA()');return false"
    That is some awful code.
    Last edited by hemebond; 03-04-2005 at 02:12 AM.
    Forget style. Code to semantics. Seperate style from structure, and structure from behaviour.
    I code to specs, and test only in Firefox (unless stated otherwise).

  • #4
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    It's what you get for using DreamWeaver's built in scripts instead of a professional script.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #5
    New Coder
    Join Date
    Oct 2004
    Location
    Sydney
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by liorean
    It's what you get for using DreamWeaver's built in scripts instead of a professional script.
    Any suggestions???

    RE: hemebond's response - it works. but ideally i want to go to the bottom of the page. This will be a good fall back.
    >>Aweful code - Hey this was my first site!


    RE: _Aerospace_Eng_ response - the result is that it jumps to the bottom of the page then back to the position where the user was last.

  • #6
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Try this
    Code:
    href="#lsRet"
    or put an id attribute on the result title row, and point to that. Remove the
    Code:
    return false
    if you do this.
    Forget style. Code to semantics. Seperate style from structure, and structure from behaviour.
    I code to specs, and test only in Firefox (unless stated otherwise).

  • #7
    New Coder
    Join Date
    Oct 2004
    Location
    Sydney
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    >> href="#lsRet"

    SPOT ON TIGER. nice one...


  •  

    Posting Permissions

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