Browswer Window moving when opening a new window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Allan

    Browswer Window moving when opening a new window

    Hi all,

    I have a very long page with a lot of text.

    Some of this content have links that open a new brower window with
    more details. However, the new window opens, the original window goes
    back to the top of the page which is annoying because then you have to
    scroll down again to be where you let of.

    Any ideas how to resolve that?

    Thanks in advance for your help

    A.S.
  • Randy Webb

    #2
    Re: Browswer Window moving when opening a new window

    Allan wrote:
    [color=blue]
    > Hi all,
    >
    > I have a very long page with a lot of text.
    >
    > Some of this content have links that open a new brower window with
    > more details. However, the new window opens, the original window goes
    > back to the top of the page which is annoying because then you have to
    > scroll down again to be where you let of.
    >
    > Any ideas how to resolve that?[/color]

    Yes, return false from your onclick handler:

    <a href="page.html " onclick="functi onName();return false">Your text</a>

    Comment

    • Andrew Urquhart

      #3
      Re: Browswer Window moving when opening a new window

      *Allan* wrote:[color=blue]
      > Hi all,[/color]

      Hello
      [color=blue]
      > I have a very long page with a lot of text.[/color]

      Sidenote: I hope it makes good use of nested headings so that those
      folks with screen readers can easily skip sections.
      [color=blue]
      > Some of this content have links that open a new brower window with
      > more details. However, the new window opens, the original window goes
      > back to the top of the page which is annoying because then you have to
      > scroll down again to be where you let of.
      >
      > Any ideas how to resolve that?[/color]

      You could fix the problem at its source and not open a *new* window
      (K.I.S.S.) Otherwise check out <URL: http://jibbering.com/faq/#FAQ4_24>
      and the part about a graceful fallback for clients without javascript -
      in your case it's likely that you've a '#' in your href and you're
      missing the 'return false;' statement mentioned in the FAQ there.

      Sidenote: The success of any popup function is determined by the type of
      pop-up blocker that the user may or may not have installed. If the user
      has a javascript capability and it's enabled, but also has a
      particularly dumb pop-up blocker (perhaps on a corporate firewall), then
      the pop-up function may execute and return without erroring but without
      actually opening the desired new window. Unfortunately then the 'return
      false;' cancels the browsers default event behaviour for hyperlinks and
      doesn't navigate to the original href, leaving the user 'clicking' a
      link and getting neither the pop-up nor the fall-back href.
      --
      Andrew Urquhart
      - FAQ: www.jibbering.com/faq/
      - Contact me: http://andrewu.co.uk/contact/
      - This post is probably time-stamped +1 hour - blame my ISP (NTL)


      Comment

      Working...