search
HomeWeb Front-endHTML TutorialHow to prevent Flash from blocking div elements in HTML

This time I will show you how to prevent Flash from blocking div elements in HTML. What are the precautions for preventing Flash from blocking div elements in HTML? The following is a practical case. Let’s take a look. .

When I was writing a flash

advertising code today, because the links that come with flash can easily be regarded as pop-up ads, I made a div layer and placed it on top of the flash, so that the links are all The one triggered by a will not be intercepted, but it is found that the flash is always above the div layer. It turns out that the flash needs to add a parameter. How to place flash under the DIV layer, so that flash does not block the floating layer or
drop-down menu, so that Flash does not block the floating object or key parameter of the layer: wmode=opaque. The method is as follows:
For IE, add the parameter in
For FF, add the parameter in Add parameter wmode="opaque"
Script House usage code:

<!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></head>  
<body>  
<div id="jb51">  
<div id="div1">  
<script type="text/javascript">  
document.write(&#39;<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">&#39;);   
document.write(&#39;<param name="movie" value="http://img.jb51.net/image/22cn_jb51net.swf" />&#39;);   
document.write(&#39;<param name="quality" value="high" /><param name="wmode" value="opaque" />&#39;);   
document.write(&#39;<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>&#39;);   
document.write(&#39;</object>&#39;);   
</script>  
</div>  
<div id="div2">  
<a href="http://i.am.cn/?s=jb51pic2" target="_blank"><img  src="/static/imghwm/default1.png"  data-src="http://img.jb51.net/image/touming.png"  class="lazy"      style="max-width:90%"  style="max-width:90%"/ alt="How to prevent Flash from blocking div elements in HTML" ></a>  
</div>  
</div>  
</body>  
</html>

Standard Flash insertion


Set height and width:

width="400" height="400"

Set path:

data="style/flash/001.swf" 与 value="style/flash/001.swf"

Alternate text or alternative image:

<a href="" title=""><img src="/static/imghwm/default1.png"  data-src="" alt="  class="lazy"   alt="" /></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"><img src="/static/imghwm/default1.png"  data-src="style/img/001.jpg"  class="lazy"   alt="Flash动画" /></a>  
</object>

Flash that will not cover the layer

<!-- 不会遮住层的Flash    
让Flash不档住浮动对象或层的关键属性:   
<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"><img src="/static/imghwm/default1.png"  data-src="style/img/001.jpg"  class="lazy"   alt="Flash动画" /></a>  
</object>


Transparent Flash


<!-- 透明的Flash   让Flash透明的关键属性:   <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"><img src="/static/imghwm/default1.png"  data-src="style/img/001.jpg"  class="lazy"   alt="Flash动画" /></a>  
</object>

wmode attribute/parameter value Window | Opaque | Transparent

Template variable: $WM, (optional ) allows the use of transparent Flash content,
absolute positioning, and layered display features in Internet Explorer 4.0. This tag/property is only valid on Windows with the Flash Player ActiveX control.
"Window" uses the movie's own rectangular window to play the application on the Web page. "Window" indicates that this Flash application has no interaction with the HTML layer and is always on top.
"Opaque" causes the application to hide all content behind it on the page.
"Transparent" causes the background of the HTML page to show through any transparent parts of the application and may reduce animation performance.
"Opaque windowless" and "Transparent windowless" both interact with HTML layers, allowing the layer above the SWF file to obscure the application. The difference between the two options is that "Transparent" allows transparency, so if a part of the SWF file is transparent, the HTML layer underneath the SWF file can show through that part, while "opaque" does not. .
If this property is omitted, the default value is Window. Applies to object only.

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

htmlHow to use the title attribute to display text on mouse hover

htmlHow to use hyperlinks Open a new window and control the window properties

##How should a tag href attribute and onclick event be used

The above is the detailed content of How to prevent Flash from blocking div elements in HTML. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How do you set the lang attribute on the  tag? Why is this important?How do you set the lang attribute on the tag? Why is this important?May 08, 2025 am 12:03 AM

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

How do you create a list in HTML?How do you create a list in HTML?May 06, 2025 am 12:01 AM

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

HTML in Action: Examples of Website StructureHTML in Action: Examples of Website StructureMay 05, 2025 am 12:03 AM

HTML is used to build websites with clear structure. 1) Use tags such as, and define the website structure. 2) Examples show the structure of blogs and e-commerce websites. 3) Avoid common mistakes such as incorrect label nesting. 4) Optimize performance by reducing HTTP requests and using semantic tags.

How do you insert an image into an HTML page?How do you insert an image into an HTML page?May 04, 2025 am 12:02 AM

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

HTML's Purpose: Enabling Web Browsers to Display ContentHTML's Purpose: Enabling Web Browsers to Display ContentMay 03, 2025 am 12:03 AM

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

Why are HTML tags important for web development?Why are HTML tags important for web development?May 02, 2025 am 12:03 AM

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

Explain the importance of using consistent coding style for HTML tags and attributes.Explain the importance of using consistent coding style for HTML tags and attributes.May 01, 2025 am 12:01 AM

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.