Processing of scroll bars in html and flash embedded in it

Source: Internet
Author: User

We often encounter this situation during development: a.swf is added to the webpage, And the.swf and html pages have a scroll bar at the same time. The Project Manager raises a bt -----processing a.swf. When the cursor is scroll, the html page does not scroll, otherwise, scroll the html page! What should I do? Method. When the mouse is moved to the.swf scroll area: When the browser is moved to the.swf scroll area, the browser is informed that the wmode of the browser is set to "window ". summary: Setting wmode to "window" may not meet the project requirements, so that a.swf can block any html page under it; when you move the mouse to the.swf scroll area and press Alt + Tab to switch the page, you are not notified to add a browser scroll listener for JS, so there is no way to scroll back to the html page after the operation. There is no way to scroll back to the html page. .a.swf cancels its mouse scroll listening event and adds the scroll processing interface for JS calls. For example, when the mouse is moved to the.swf scroll area: notify JS, for example, when the mouseisinflashwheelrange=true.3.mouse moves out of the.swf rolling area: Notify JS, for example, mouseIsInFlashWheelRange = false; 4. JS listens to mouse scroll events. In the event listening processing function, we need to make the following judgment. Refer to the self-html tutorial. http://www.software8.co/wzjs/html/2842.htmlJava Code: if (mouseIsInFlashWheelRange = true) {/** call a.swf's interface to simulate a. SWF rolling * // ** "flash" is the ID of a.swf embedded in html, and value is the scrolling value of the html Rolling Table */document. getElementById ("flashID "). wheelToFlash (value);/** prevents the bubble of html page mouse events, usually event. preventDefault () */event. preventDefault ();} else {/** handle normal html scrolling. We don't need to do anything. */} conclusion: compared with method 1, wmode = "window" is absent. The Alt + Tab problem still exists. Note: When writing JavaScript code, we need to pay attention to compatibility issues. Different browsers listen to mouse events and obtain scroll values differently!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.