The solution I found online was to add Html5shiv's Google reference to the head tag, with the following address:Note: Copy the code to the Head section, and remember that the head section must be (because IE has to know the element before parsing the element, so the JS file cannot be called elsewhere, otherwise it will fail) Don't forget to add the block attribute to these custom tags: /*html5*/Article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block} However ,
Function descriptionLocal previews of images via JavaScript (no uploading to the server), compatible with all browsers (ie6ie6+, Chrome, Firefox).Implementation EssentialsFor Chrome, Firefox, IE10 use FileReader.For ie6~9, use filter filter:progid:DXImageTransform.Microsoft.AlphaImageLoader to implement. DOCTYPE HTML> HTML> Head> Metahttp-equiv= "Content-type"content= "Text/html;charset=utf-8" /> style
However, IE6 has two lines of JS
Code You can, IE7 and above are similar, but a security prompt is quite disgusting. If you see it, you must have doubts;
But Firefox and chrome won't let you copy them;
I remember that I had this code on the Internet. I found that I could not find it in firefox3.5 or later versions. I finally found one. The code is quite complex and not very dare to use it.
Finally, there was no way to check the information and I wrot
However, IE6 can use two lines of JS Code, and IE7 and above are similar, but a security prompt is disgusting. If you see it, you must be skeptical;But Firefox and Chrome won't let you copy them;I remember that I had this code on the Internet. I found that I could not find it in firefox3.5 or later versions. I finally found one. The code is quite complex and not very dare to use it.Finally, there was no way to check the information and I wrote one:The
= obj.getelementsbytagname (*)//The previous step is to get all the label elements of the pagefor (var i = 0;i if (Arr[i].classname = = ClassName) {List.push (Arr[i]);}}return list;}}Traverse all elements to find the element with the class name specifiedFour: Questions about dealing with blank text nodes1. Ignore blank text nodesfunction fn (nodes) {var arr = [];for (var i = 0;i if (Nodes[i].nodetype = = =
But the headache is that many attributes of CSS3 are not supported by all browsers. I have always liked using a rounded rectangle as a container. After searching and exploring, I finally found a way to make the rounded corner compatible with all browsers.This method is implemented using CSS + JS.Introduce CurvyCorners (a JS rounded corner library, which uses
simple implementation Copy to clipboard function demo as follows:Demo Download (Warm tip: Download the code of the classmate, browse the demo when you remember to use the server environment, otherwise do not see the effect of ~)The above code in conjunction with the function of the Operation node jquery, excellent play the role of jquery.zclip.js, such as pre-and post-replication operations, dynamic insertion of nodes, but also visible jquery.zclip.js powerful, use is very simple. You need to l
your own layout required width value, please control the relevant code link to modify;All of the above demo, do not set the spacing between them, if you want to have a certain distance between them, there are two methods may be implemented, one on the above demo basis to modify the relevant parameters, and second, in the corresponding inside with "div" tag, and set its "padding" value, so more secure, Not to break your layout.Because we have a column
The so-called safe font, is in all browsers can be displayed in the normal font, that is, all operating systems installed by default fonts.
There are 21 kinds of secure fonts: Font-family:arial, Helvetica, Sans-serif;font-family: ' Arial black ', Gadget, Sans-serif;font-family: ' Bookman old Style ', serif;Font-family: ' Comic Sans MS ', cursive;Font-family:couri
The custom DateDiff function in JavaScript is compatible with all browsers. DateDiff is used to return the time interval between two dates.
The Code is as follows:
This article describes how to use the js replication plug-in Zero compatible with all browsers. For more information, see the following three plug-ins:
Jquery. js
ZeroClipboard. js
ZeroClipboard.swf
Good luck!
The Code is as follows:
Click to copy
are some special characters in HTML, please click the HTML special character encyclopedia.With special characters, the above effect can be achieved by using the margin or position method in CSS.The code is as follows:DOCTYPE HTML>HTMLLang= "en -us">Head>MetaCharSet= "UTF-8">title>Character Making triangle bordertitle>styletype= "Text/css">*{margin:0;padding:0;}Body{font-family:SimSun;}H1{text-align:Center;}. Demo1{width:300px;margin:20px Auto;Border:1px solid Red;Height:100px;}. Demo1 Em,.demo1
-I extend a myforeach on the prototype of the built-in class to handle the problem of foreach incompatibilityCallBack: A callback function that iterates through an item in an array to perform a callBackContext: Change the this point in the callback methodArray.prototype.myForEach = function Myforeach (callBack, context) {typeof context = = = = "undefined"? context = Window:null;if ("ForEach" in Array.prototype) {This.foreach (callBack, context);return; }//-> Incompatible ProcessingFor (var i
There are many ways to draw lines using JavaScript, such as SVG, VML, and canvas. However, at this stage, it seems that these methods are not compatible with all browsers. So I wrote a line-Drawing Method in the most primitive way. The idea is also very simple, that is, to splice a line with a pixel Div.
Function line (startx, starty, endx, Endy, container ){If (startx = endx ){If (starty> Endy ){VaR Tempy
Code Region (other codes are included, please remove) -->The toolbar can be moved to the top of the webpage without JS (compatible with all browsers) Article Content Article content Article content Article content Article content Article content Article content Article content Article content Article content Article content Article content Article content Article content Article content Article content Arti
Solution:
① Two layers stacked together
② Use translucent PNG (recommended)
The background is transparent but the text is not transparent
Supports IE, Firefox, chrome, and opera
Supports all browsers
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Html
>
Title
>
Transparent
Title
>
1. Close the window without any hint JS code
Window.close () is OK, but it will give you a hint. The page you are viewing is attempting to close the window. Do you want to close the window? "How can you not eject this hint?""If you open this page for the first time, Window.close () will pop-up prompts, if this page is from other pages window.open () out of the page, Window.close (), it will not appear
The code is as follows
Copy Code
2. Custom Prompt shut
HTML5 can use video tags to play videos
Currently, the video element supports three types of videos:
format
ie
Firefox
Opera
Chrome
Safari
Ogg
No
3.5+
10.5+
5.0+
No
mpeg 4
9.0+
No
no
3.0+
5.0+
WebM
No
4.0+
10.6+
6.0 +
No
Ogg = Ogg file with Theora video encoding and Vorbis audio encoding
Under IE, the code located under the tag is not displayed in the page, which is useful for hiding some HTML code.
But in non-IE browser, the mark is invalid, can be separately in IE and FF test the following code, you know the effect.
Copy Code code as follows:
Workaround:
Define comment {Display:none} in CSS can become common in all browsers.
Copy Code code as follows:
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.