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

Several ways to center a box in Web development

1. Record several methods of centering the box: 1...

Two ways to install Python3 on Linux servers

First method Alibaba Cloud and Baidu Cloud server...

The presentation and opening method of hyperlink a

<br />Related articles: How to prompt and op...

Vue Basic Tutorial: Conditional Rendering and List Rendering

Table of contents Preface 1.1 Function 1.2 How to...

Teach you how to deploy Vue project with Docker

1.Write in front: As a lightweight virtualization...

Start nginxssl configuration based on docker

Prerequisites A cloud server (centOS of Alibaba C...

Vue routing relative path jump method

Table of contents Vue routing relative path jump ...

Tic-Tac-toe game implemented in pure CSS3

Operation effect: html <div class="tic-ta...

Interpretation of the module for load balancing using nginx

Table of contents Two modules for using nginx for...

MySQL 8.0.17 installation and usage tutorial diagram

Written in front In the past and in the current p...

Detailed code for adding electron to the vue project

1. Add in package.json "main": "el...