focus causing browser lurching

Discussion in 'Javascript' started by Alex Calder, Sep 16, 2006.

  1. Alex Calder

    Alex Calder Guest

    How's that for a subject line? :)

    OK, here's the deal.

    I have a web page that features a Flash movie about halfway down the
    page, and inside that Flash movie is content that typically exceeds
    the height of the movie, and accordingly, scrolls via use of a scroll
    bar.

    I've been testing out this page on friends, and the common complaint
    is --

    When using the roller wheel on the mouse, the whole browser page
    scrolls, but there's no way to scroll the content in the Flash window.
    (Don't worry, I'll get to the Javascript question here in moment.)

    So, by use of the onMouseWheel listener in Flash, the user can now
    scroll the Flash content using their roller wheel on their mouse --
    but only if the Flash movie is in focus.

    So, now, the roller wheel scrolls the browser page, unless they click
    on / in the Flash movie, thus the movie takes focus and now the roller
    wheel controls the Flash movie.

    So, I added Javascript code to the div tag for the Flash movie,
    setting it up where the div takes focus on mouseover, and releases
    focus (blur) upon mouseout. This gets me about 99% of the way there,
    as the roller wheel now rolls the browser page, but upon mousing over
    the Flash, the movie takes focus and the roller wheel controls the
    Flash movie, and once moused out of the movie, you control the browser
    page again. Sweet.

    The only problem left? When you mouse over the movie, the focus
    taking causes the top of the div tagged area to lurch to the top of
    the viewable browser window display.

    Is there a way to allow something to take focus without it jumping to
    the top of the page? Does it involve noting the browser scroll
    position, setting the focus, then resetting the browser scroll
    position again? Or is it easier? Or not possible at all to change
    that focus behavior?

    Thanks to everybody for any assistance you can provide. I appreciate
    the help.

    Alex
     
    Alex Calder, Sep 16, 2006
    #1
    1. Advertising

  2. Alex Calder

    Tom Cole Guest

    Alex Calder wrote:
    > How's that for a subject line? :)
    >
    > OK, here's the deal.
    >
    > I have a web page that features a Flash movie about halfway down the
    > page, and inside that Flash movie is content that typically exceeds
    > the height of the movie, and accordingly, scrolls via use of a scroll
    > bar.
    >
    > I've been testing out this page on friends, and the common complaint
    > is --
    >
    > When using the roller wheel on the mouse, the whole browser page
    > scrolls, but there's no way to scroll the content in the Flash window.
    > (Don't worry, I'll get to the Javascript question here in moment.)
    >
    > So, by use of the onMouseWheel listener in Flash, the user can now
    > scroll the Flash content using their roller wheel on their mouse --
    > but only if the Flash movie is in focus.
    >
    > So, now, the roller wheel scrolls the browser page, unless they click
    > on / in the Flash movie, thus the movie takes focus and now the roller
    > wheel controls the Flash movie.
    >
    > So, I added Javascript code to the div tag for the Flash movie,
    > setting it up where the div takes focus on mouseover, and releases
    > focus (blur) upon mouseout. This gets me about 99% of the way there,
    > as the roller wheel now rolls the browser page, but upon mousing over
    > the Flash, the movie takes focus and the roller wheel controls the
    > Flash movie, and once moused out of the movie, you control the browser
    > page again. Sweet.
    >
    > The only problem left? When you mouse over the movie, the focus
    > taking causes the top of the div tagged area to lurch to the top of
    > the viewable browser window display.
    >
    > Is there a way to allow something to take focus without it jumping to
    > the top of the page? Does it involve noting the browser scroll
    > position, setting the focus, then resetting the browser scroll
    > position again? Or is it easier? Or not possible at all to change
    > that focus behavior?


    A link to the problem page (if available) would be very helpful. If you
    friends can see it I assume we can too....

    Giving something focus would not cause it to move. There's something
    else going on there, it will be much easier to figure that out if we
    can see the page contents.

    >
    > Thanks to everybody for any assistance you can provide. I appreciate
    > the help.
    >
    > Alex
     
    Tom Cole, Sep 16, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Whitney
    Replies:
    1
    Views:
    99
    Grant Wagner
    Jul 29, 2003
  2. Robert Nurse

    JS Alert Causing Loss Of Window Focus???

    Robert Nurse, Nov 5, 2004, in forum: Javascript
    Replies:
    2
    Views:
    228
    Robert Nurse
    Nov 8, 2004
  3. Roger
    Replies:
    3
    Views:
    379
  4. Replies:
    6
    Views:
    151
    Thomas 'PointedEars' Lahn
    Nov 3, 2008
  5. Replies:
    1
    Views:
    111
    Kev Dwyer
    Apr 13, 2013
Loading...

Share This Page