By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

focus causing browser lurching

P: n/a

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
Sep 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

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
Sep 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.