Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Both html and embedded flash have scroll bars. How to deal with them?

2025-02-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to deal with scrollbars in both html and embedded flash". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Method 1:

1. When the mouse moves into the a.swf scrolling area: tell JS to remove the mouse scrolling monitor.

two。 When the mouse moves out of the a.swf scroll area: tell JS to add mouse scrolling monitoring to the browser.

3.a.swf 's wmode is set to "window".

Summary: setting wmode to "window" may not meet the project requirements, which makes a.swf obscure any html pages below it; in addition, when the mouse moves into the a.swf scrolling area and presses Alt+Tab to switch pages, it does not tell JS to add mouse scrolling monitoring to the browser, so there is no scrolling processing when switching back to the html page after operation.

Method 2:

1.a.swf cancels its own mouse scroll listening event and adds a scrolling handling interface for JS to call, such as wheelToFlash (value).

two。 When the mouse moves into the a.swf scroll area: inform the JS, such as mouseIsInFlashWheelRange=true.

3. When the mouse is moved out of the a.swf scroll area: inform the JS, such as mouseIsInFlashWheelRange=false

4.JS listens for mouse scrolling events. In the event listener handler, we need to make the following judgment

Javascript Code:

Copy the code

The code is as follows:

If (mouseIsInFlashWheelRange==true)

{

/ * * call the interface provided by a.swf to make a.swf simulate scrolling * /

/ * "flash" is the ID of a.swf embedded in html, and value is the value of html scrolling table * /

Document.getElementById ("flashID") .wheelToFlash (value)

/ * * prevent the bubbling of mouse events on html pages, usually event.preventDefault () * /

Event.preventDefault ()

}

Else

{

/ * * deal with the normal scrolling of html, we don't need to do anything * /

}

This is the end of the content of "how to deal with scrollbars in both html and embedded flash". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report