Tips on how to prevent HTML div elements from being blocked by Flash _ HTML/Xhtml _ webpage creation and _ htmlxhtml

Source: Internet
Author: User

Tips on how to prevent HTML div elements from being blocked by Flash _ HTML/Xhtml _ webpage creation and _ htmlxhtml

Today, when writing a flash advertisement code, the link provided by flash is easy to be regarded as a pop-up advertisement, so a div layer is placed on the flash, in this way, the link is triggered by a and will not be intercepted. However, it is found that flash is always on the div layer. In the original flash, a parameter is required.

Place flash Under the DIV layer, so that flash does not block the floating layer or drop-down menu, so that Flash does not file the key parameter of the floating object or layer: wmode = opaque.

The method is as follows:

For IE, add the parameter <param name = "wmode" value = "opaque"/> to <object> </object>
Add the wmode = "opaque" parameter to FF <embed/>"

Script home code:


Copy XML/HTML Code to clipboard
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> 22cn </title>
<Style type = "text/css">
<! --
Body {
Position: relative;
Z-index: 0;
Margin: 0; padding: 0
}
Body, td, th {
Color: #333333;
}
* {Margin: 0; padding: 0}
Img {border: 0}
# Jb51 {position: relative; width: 300px; height: 250px}
# Div1 {
Position: absolute;
Left: 0;
Top: 0;
Width: 300px;
Height: 250px; z-index:-1

}
# Div2 {
Position: absolute;
Left: 0;
Top: 0;
Width: 300px;
Height: 250px;
Z-index: 99999;
}
-->
</Style> <Body>
<Div id = "jb51">
<Div id = "div1">
<Script type = "text/javascript">
Document. write ('<object classid = "clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width = "300" height = "250"> ');
Document. write ('<param name = "movie" value = "http://img.jb51.net/image/22cn_jb51net.swf"/> ');
Document. write ('<param name = "quality" value = "high"/> <param name = "wmode" value = "opaque"/> ');
Document. write ('<embed src = "http://img.jb51.net/image/22cn_jb51net.swf" quality = "high" pluginspage = "http://www.macromedia.com/go/getflashplayer" type = "application/x-shockwave-flash" width = "300" height = "250 "wmode =" opaque "> </embed> ');
Document. write ('</object> ');
</Script>
</Div>
<Div id = "div2">
<A href = "http:// I .am.cn /? S = jb51pic2 "target =" _ blank "> </a>
</Div>
</Div>
</Body>
</Html>
Standard Flash insert

Copy XML/HTML Code to clipboard
<! -- Standard Flash insert
Set height and width:
Width = "400" height = "400"
Set path:
Data = "style/flash/001.swf" and value =" style/flash/001.swf"
Replace text or image:
<A href = "" title = ""> </a>
-->
<Object type = "application/x-shockwave-flash" data = "style/flash/001.swf" width =" 400 "height =" 400 ">
<Param name = "movie" value = "style/flash/001.swf"/>
<A href = "style/flash/001.swf"> </a>
</Object>
Does not cover layer Flash

Copy XML/HTML Code to clipboard
<! -- Does not cover layer Flash
Make Flash not stick to the key attributes of floating objects or layers:
<Param name = "wmode" value = "opaque"/>
<Embed wmode = "opaque"> </embed>
-->
<Object type = "application/x-shockwave-flash" data = "style/flash/001.swf" width =" 400 "height =" 400 ">
<Param name = "movie" value = "style/flash/001.swf"/>
<Param name = "wmode" value = "opaque"/>
<Embed wmode = "opaque"> </embed>
<A href = "style/flash/001.swf"> </a>
</Object>
Transparent Flash

Copy XML/HTML Code to clipboard
<! -- Transparent Flash
Key attributes that make Flash transparent:
<Param name = "wmode" value = "transparent">
-->
<Object type = "application/x-shockwave-flash" data = "style/flash/001.swf" width =" 400 "height =" 400 ">
<Param name = "movie" value = "style/flash/001.swf"/>
<Param name = "wmode" value = "transparent">
<A href = "style/flash/001.swf"> </a>
</Object>
Wmode attribute/parameter value Window | Opaque | Transparent
Template variable: $ WM (optional) allows you to use transparent Flash content, absolute positioning, and hierarchical display in Internet Explorer 4.0. This tag/attribute is only valid in Windows with the Flash Player ActiveX control.

"Window" uses the film's own rectangular Window on the Web page to play the application. "Window" indicates that the Flash application has no interaction with the HTML layer and is always at the top layer.
"Opaque" hides all content on the page after the application.
"Transparent" enables the background of an HTML page to be displayed through all the Transparent parts of the application, and may reduce the animation performance.
Both "Opaque windowless" and "Transparent windowless" can interact with the HTML layer to allow the layer above the SWF file to mask the application. The difference between the two options is that "Transparent" allows transparency. Therefore, if a part of the SWF file is Transparent, the HTML layer below the SWF file can be displayed through this part, "opaque" is not displayed.

If this attribute is ignored, the default value is Window. Only applicable to objects

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.