Solution: Cover and block flash and DIV, and FF cannot display innerhtml and other elements

Source: Internet
Author: User
Tags jquery library

1. Description
For a countdown JS script, see my previous articleArticleAfter the artist adds flash, the DIV layer is blocked by flash. It should be said that this is a classic problem, I also found a solution for blocking flash and DIV in different browsers for a long time;
CSS: Z-index is used on the Internet to solve the problem, but the effect is not good.
The real solution is:
For IE, add the following labels to <Object>: <Param name = "wmode" value = "Transparent">. It is worth noting that there are more than one value, you can search online if necessary;
For ff and chrome, the above settings are ineffective. You need to add the following attribute to the <embed> tag: wmode = "Transparent ";
This is a perfect solution

Example:

<Object classid = "CLSID: d27CDB6E-AE6D-11cf-96B8-444XXX540000 "codebase =" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0 "width =" 1200 "Height =" 600 "Title =" Flash "> <Param name =" movie "value =" Flash/xxx.swf "/> <param name = "quality" value = "high"/> <Param name = "wmode" value = "Transparent"> <embed wmode = "Transparent" src = "Flash/xxx.swf" width = "1200" Height = "600" Quality = "high" pluginspage = "http://www.macromedia.com/go/getflashplayer" type = "application/X-Shockwave-flash"> </embed> </Object>

Take a closer look at the two parameters added.
2. New Problems
In this project, the problem in IE and chrome is indeed solved according to the above method, but the countdown still cannot be displayed in ff. The strange thing is that in the previous project, it is completely solved, and FF is also normal, so that I focus on the problem to block the flash and Div layers. I searched the internet for half a day and did not find it.
I mentioned the following in an article:
Let's take a look at the original Code :
Liveclock. innerhtml = "now off" + symbol + "end" + hour2 + "Hour" + minute2 + "Minute" + second2 + "second ";
No jquery library is used;
This code is normal in IE and chrome, but the countdown cannot be displayed in Firefox;
I thought it was FF's poor support for innerhtml fragments. I also found some bugs and solutions on the Internet, but they did not solve my problem;

The real code is:
Document. getelementbyid ("liveclock "). innerhtml = "now" + symbol + "and" + hour2 + "Hour" + minute2 + "Minute" + second2 + "second ";
No
This is the reason. In ff, the location tag must be the getelementbyid method, which is completely normal in IE and chrome. This masks the code problems. According to the strict W3C documentation, firefox is true, but it seems rigid.
In addition, when I tested the code function, I actually tried ff, which is completely normal. At that time, I didn't use getelementbyid, but the display was also normal. Later I realized that when I tested the function, there is no HTML Tag that is too complex, and there is a div box, so this problem is not found.

useful articles: http://huangyunbin.iteye.com/blog/1110675
http://hi.baidu.com/cylic12345/blog/item/01c4b6c9ff654710be09e621.html
http://www.ittang.com/2010/0128/10682.html
3, modify the 3-second countdown function (to be added)

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.