If you want to be compatible with multiple browsers to determine the user's browser type, if it is Firefox or ie6,7,8, so that they can not be judged by the difference between the operation.
Simple code
//Add to Favorites Function Addtofavorite () { if (document.all) { Window.external.addfavorite (Document.url,document.title); }else if (window.sidebar) { Window.sidebar.addpanel ( Document.title, Document.url, ""); } }
//Set a
Add, modify, and delete option elements in Firefox and Opera,select compatible with the following code:
function Watch_ini () {//Initial
for (var i=0; ivar ooption=new option (Arguments[i],arguments[i]);
document.getElementById ("Myselect"). Options[i]=ooption;
}
}
function Watch_add (f) {//Increase
var ooption=new option (F.word.value,f.word.value);
F.keywords.options[f.keywords.length]=ooption;
}
Frequently used about sele
Page layout + pure CSS vertical drop-down menu NBSP;IE6/IE7 compatible
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Copy Code code as follows:
function getXml () {
Get input value
var name = Textname.getvalue ();
var pwd = Textpwd.getvalue ();
Initializing objects
var xmldoc = document.implementation.createDocument ("", "", null);
Xmldoc.async= "false";//Cancel the action submitted by the XML without completing the complete completion of the data
XML Header Authoring
var header=xmldoc.createprocessinginstruction ("xml", "version= ' 1.0");
Xmldoc.appendchild (header);
To create a child tree
;//Display the object as a table at the block element level} or. hackbox{Clear:both;or add: After (Pseudo object), set in the object after the occurrence of content, usually with content with use, IE does not support this pseudo object, not IE browser support,So it doesn't affect the Ie/win browser. This is the most troublesome ... #box: after{content: "."; display:block; height:0; clear:both; visibility:hidden;}
8 Div Floating IE text produces 3 pixel bugsThe left side of the object floating o
Now on the internet to the top of the components, do not understand a large section of people do not understand the JavaScript code, but also a variety of incompatible. Starting with this component, you can fully use JavaScript scrolling events window.onscroll with position:fixed handwriting. IE6 compatibility problems mainly appear on position:fixed, how to solve the position:fixed problem in the "CSS" IE6 and the effect of scrolling with the scroll bar (click to open the link) introduced.
Her
, and then let the elements inside the ocean-like container horizontal and vertical positioning.Code hint
The code is as follows
Copy Code
. outer {/* External Visual Area container * *width:100px; height:100px;position:relative;Overflow:hidden;}. container {* * Inside the broad ocean/width:1000px; height:1000px;Position:absolute; left:50%; top:50%;Margin: -500px 0 0-500px;}
instance-element hover magnification effectTo achieve the effect as follows:
The
Lenovo note Printer under the WIN7 system, add the epson1600k compatible drive method:
1, click the "Start" menu, select "Equipment and Printers";
2, click to open "Add Printer";
3, click "Add Local Printer", automatically into the next step;
4, in the "Use the existing port (U):" The Right Drop-down box to select the corresponding port type, click "Next" to continue;
5, from left to right select "Epson",
Keil MDK RTE is compatible with KEIL4 stm32f10x standard library 1. Problem
In the beginning of learning embedded, is from the 51 SCM start, the use of KEIL4 development environment, with very handy. Until recently contacted arm to learn STM32 and its library functions.
At first I studied STM32 's version 3.5 standard library "stm32f10x Standard Peripherals Library", but later found that the acquisition of Keil company developed a more powerful MDK,
Click "Register" on the page, there is a layer of opaque black mask, the top of the mask layer is the registration box, at this time can not click on the page other than the registration box elements, click on the Registration box "casually stroll", mask layer disappear.
Preview Address:
http://jsfiddle.net/p2x3c7df/embedded/result/
Points:
1. The registration box is always horizontally and vertically centered, including the mouse wheel scrolling down the page, scaling the page and adjusting
This article describes the JS compatible Firefox to get the image width and height of the method. Share to everyone for your reference. The implementation methods are as follows:
I hope this article will help you with your JavaScript programming.
Requirements
1. Enter @, pop-up matching buddy menu
2. When the cursor enters a label containing the @ buddy, the pop-up menu
3. Press BACKSPACE Delete, if the cursor is preceded by a "@ Buddy" tag, pop-up menu
4. Compatible Ie,firefox.
Specific approach
For requirements one, it is natural to think of binding events on the input box. This is to bind the MouseDown, not the MouseUp. Because if it is MouseUp, using event.preventdefault () cannot pr
This article describes the JS implementation compatible with IE, FF, Chrome, opera and Safari music players. Share to everyone for your reference. The implementation method is as follows:
/** Music player * @param obj player ID * @param file Audio file mp3:ogg: * @param loop whether loop/function Audioplayer (ID, file, lo
OP) {var audioplayer = document.getElementById (ID);
if (audioplayer!=null) {document.body.removeChild (Audioplayer); }
Compatible with the mainstream browser's Iframe adaptive height, the JS script is as follows:
Copy Code code as follows:
IFRAME highly adaptive
function Iframeautofit (iframeobj) {
settimeout (function () {
if (!iframeobj) return;
Iframeobj.height = (iframeobj.document iframeObj.Document.body.scrollHeight: IframeObj.contentDocument.body.offsetHeight);
}, 200);
}
Call Method:
Copy Code code as follows:
H
Customattributedemo (obj)
{
if (Obj.clickcount = = ' 0 ')
{
Obj.clickcount = ' 1 ';
}
Else
{
Obj.disabled = true;
}
}
The above code will fail under Firefox because Firefox has a higher limit on the use of custom attributes and can only access it using the attributes[] collection, Firefox code:
Copy Code code as follows:
function Customattributedemo (obj)
{
if (obj.attributes[' clickcount '].nodevalue = = ' 0 ')
{
obj.attributes[' clickcount ']
Copy Code code as follows:
Irefox in continuous English characters if you want to CSS control forced line, explore the N for a long time, found to be unable to achieve the forced when the use of JS script to control it
The English character wraps automatically, truncates the string through the JS script, this method general Ie6,ie7,firefox compatible solution
Sssssssssssssssssssssssssssssssssssssssssssssssss
Currently, if you use JavaScript to write code that is copied to the Clipboard, it is generally not compatible with browsers. So the way to use flash, simulation of a layer, and then to copy, you can do all the browser application Oh ~
Need to download a SWF file, and a JS file. Put the two files, and the HTM together.
Icon:
Must be placed on the server side to use OH.
Icon:
JS Code:
Copy Code code as follows:
Zeroclipboard.js
S
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.