Hello and welcome to our community! Is this your first visit?
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
    Jan 2003
    Thanked 0 Times in 0 Posts

    Question Jump to anchor on reload

    I am very new to this and would appreciate any assistance.

    I have a window (window A) that has a link on it with the following behaviour attached: onClick: resize window A to approx 1/3 of screen (assume 800*600 res), open new window (window B) to other 2/3 of screen and go to a particular URL in window B. Focus is shifted to window B. This is working fine.

    My problem is that I would like the top of window A to show the text immedately following the link that has just been clicked. When the window resizes, the text flips back to the top of the page.

    I have tried using an anchor to jump to the point I want in window A, which works...... until the page reloads to its new smaller size - it then jumps back to the top of the page.

  2. #2
    New Coder
    Join Date
    Jun 2002
    London & Oxford
    Thanked 0 Times in 0 Posts
    You will need to hard-code some anchors (<a name="whatever"></a>) into page A immediately after each possible link which could cause the page to resize. Next, you need to pass the name of the proceeding anchor as an argument to your resize function in your onclick handler. Finally, in the function which resizes page A, you will need to add a line of code at the end to make the page 'jump' to the named anchor. The syntax is:

    self.location.hash = whatever;

    Does that make sense? I hope so.

    Good luck.
    Last edited by head8k; 01-21-2003 at 03:44 PM.
    As easy as 3.1415926535897932384626433832795028841


Posting Permissions

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