Implementation code for adding links to FLASH through HTML (div layer)

Implementation code for adding links to FLASH through HTML (div layer)
Today a client wants to run an advertisement, and the material they provided is Flash. Although we don't like it very much, there is nothing we can do because the client likes Flash and is afraid that some browsers or software will block the links that come with Flash. We need to add a link through HTML, otherwise it will be blocked and the effect will not be good. You know the consequences.

I did this a few years ago when I was helping others maintain it, but I haven't done it for a long time and felt too unfamiliar with it. I have specially organized it here for the convenience of friends in need. I hope everyone will support 123WORDPRESS.COM.

The following is the complete code. Since flash files are relatively large, we use iframe to load the ads:

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml" >   
  3. < head >   
  4. < meta   http-equiv = "Content-Type"   content = "text/html; charset=gb2312"   />   
  5. < title > flash plus link_123WORDPRESS.COM exclusive </ title >   
  6. < style   type = "text/css" >   
  7. <!--
  8. body {
  9. position:relative;
  10. z-index:0;
  11. margin:0; padding:0
  12. }
  13. body,td,th {
  14. color: #333333;
  15. }
  16. *{margin:0; padding:0}
  17. img{ border:0}
  18. #jb51{ position:relative; width:300px; height:250px}
  19. #div1 {
  20. position:absolute;
  21. left:0;
  22. top:0;
  23. width:300px;
  24. height:250px; z-index:-1
  25.   
  26. }
  27. #div2 {
  28. position:absolute;
  29. left:0;
  30. top:0;
  31. width:300px;
  32. height:250px;
  33. z-index:99999;
  34. }
  35. #div2 a:link{ display:block; width:300px; height:250px}
  36. -- >   
  37. </ style > </ head >   
  38. < body >   
  39. < div   id = "jb51" >   
  40. < div   id = "div1" >   
  41. < script   type = "text/javascript" >   
  42. 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" > ');
  43. document.write(' < param   name = "movie"   value = "http://img.jb51.net/image/22cn_jb51net.swf"   /> ');
  44. document.write(' < param   name = "quality"   value = "high"   /> < param   name = "wmode"   value = "opaque"   /> ');
  45. 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 > ');
  46. document.write(' </ object > ');
  47. </ script >   
  48. </ div >   
  49. < div   id = "div2" >   
  50. <   href = "https://www.jb51.net"   target = "_blank" > < img   src = "http://img.jb51.net/image/touming.png"   width = "300"   height = "250"   /> </ a >   
  51. </ div >   
  52. </ div >   
  53. </ body >   
  54. </ html >   
Now the advertising managers are not easy to use, Baidu manager has stopped other materials, cnzz has been blocked by 360, and google's access is slow. It’s not easy to get into the backstage. There is no other choice but to put it on your own server.

A few points need to be explained:

<img src="http://img.jb51.net/image/touming.png" width="300" height="250" />The touming.png here is a 1-pixel transparent png file. If you don't want the picture, the link will be wrong in IE.

Of course, the CSS style is the most important, first position:relative, then position:absolute;

Later I saw a method provided by someone else on the Internet. It was implemented through a button, but a new window could not be opened. Please provide it as well. If you find that our product is not useful, please contact us to update it. Thank you.

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml" >   
  3. < head >   
  4. < meta   http-equiv = "Content-Type"   content = "text/html; charset=utf-8"   />   
  5. < title > Untitled Document </ title >   
  6. < style   type = "text/css" >   
  7. <!--
  8. body {
  9. position:relative;
  10. z-index:0;
  11. margin:0; padding:0
  12. }
  13. body,td,th {
  14. color: #333333;
  15. }
  16. *{margin:0; padding:0}
  17. img{ border:0}
  18. #jb51{ position:relative; width:300px; height:250px}
  19. #div1 {
  20. position:absolute;
  21. left:0;
  22. top:0;
  23. width:300px;
  24. height:250px; z-index:-1
  25.   
  26. }
  27. #div2 {
  28. position:absolute;
  29. left:0;
  30. top:0;
  31. width:300px;
  32. height:250px;
  33. z-index:99999;
  34. }
  35. -- >   
  36. </ style >   
  37. </ head >   
  38. < body >   
  39. < button   style = "width:300;height:250;background:transparent;border:o;padding:0;cursor:hand"   onclick = "window.location.href='http://s.jb51.net'" >     
  40. < object   classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"      
  41.          codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"   width = "100%"   height = "100%" >     
  42.               < param   name = "movie"   value = "http://img.jb51.net/image/22cn_jb51net.swf" >     
  43.               < param   name = "quality"   value = "high" >   
  44.               < param   name = "wmode"   value = "opaque"   />   
  45.               < embed   src = "http://img.jb51.net/image/22cn_jb51net.swf"   width = "300"   height = "250"   quality = "high"   pluginspage = "http://www.macromedia.com/go/getflashplayer"   type = "application/x-shockwave-flash"   align = "middle"    wmode = "opaque" >     
  46.                 </ embed >     
  47.              </ object >     
  48. </ button >     
  49. </ body >   
  50. </ html >   
Okay, that’s all for this article, it’s basically enough for your use. Welcome to leave comments. Original from 123WORDPRESS.COM.

<<:  How to select all child elements and add styles to them in CSS

>>:  Highly recommended! Setup syntax sugar in Vue 3.2

Recommend

Web componentd component internal event callback and pain point analysis

Table of contents Written in front What exactly i...

W3C Tutorial (1): Understanding W3C

W3C, an organization founded in 1994, aims to unl...

Clever use of webkit-box-reflect to achieve various dynamic effects (summary)

In an article a long time ago, I talked about the...

How does Vue3's dynamic components work?

Table of contents 1. Component Registration 1.1 G...

MySQL5.7 master-slave configuration example analysis

MySQL5.7 master-slave configuration implementatio...

Detailed analysis of MySQL 8.0 memory consumption

Table of contents 1. innodb_buffer_pool_size 2. i...

Practice of multi-layer nested display of element table

There is a requirement for a list containing mult...

Getting Started: A brief introduction to HTML's basic tags and attributes

HTML is made up of tags and attributes, which are...

Notes on using the blockquote tag

<br />Semanticization cannot be explained in...

Detailed steps to install mysql 8.0.18-winx64 on win10

1. First go to the official website to download t...

HTML Code Writing Guide

Common Convention Tags Self-closing tags, no need...

Solve the problem of setting Chinese language pack for Docker container

If you use docker search centos in Docker Use doc...

XHTML language default CSS style

html,address, blockquote, body,dd,div, dl,dt,fiel...

Mysql database index interview questions (basic programmer skills)

Table of contents introduction Indexing principle...