Most of the time, when browsing a Web page, we need to consider the situation where users close the window in a few hours, especially when the user has important data that has not been saved, it is necessary for our program to remind users. In this case, we can use javascript window. onbeforeunload () to prevent users from closing the window. See the following example:
In this way, when you press the close button, the following window will pop up (compati
Using JavaScript to create a very practical and simple text editing box, you can display the row number and be compatible with mainstream browsers such as ie and firefox, as shown below:
The following is the source code for this effect:
Articles you may be interested in
Move the mouse over the text to display the floating layer prompt special effects (compatible with all browsers such as IE and Firefox)
Share a drop-down menu implemented by jquery, and the code is concise and easy to modify. Jquery is used to implement the effects of the two drop-down menus. The principle is the same. It is tested to be compatible with mainstream browsers such as IE and Firefox. Paste the drop-down menu below.
Jquery drop-down menu effect 1:
Jquery drop-down menu effect 2:
Next, I will paste the effect 1 code. If you need the effect 2 code, you can modify it yourse
Share a piece of code that uses JavaScript to implement the copy function, compatible with multiple browsers, compatible with IE and Firefox browsers.
Example:
Texture address:
Articles you may be interested in
Jquery pop-up window plug-in (compatible with all browsers)
JS obtains the key code, how Js shields users' keys, and Js obtains the ASII code corr
I would like to share with you how to use js to shield users from pressing the direction keys (compatible with IE and firefox )! Add the following code to the head and body areas of the source code.
Document. onkeydown = function (e) {e = e | event; // mask the left direction key if (e. keyCode = 37) {alert ('Do not move to the left direction key! '); Return false;} // specifies the direction key for blocking the upward direction. if (e. keyCode = 38
The flash Embedded in a webpage is the top layer of all webpages by default. It does not work even if the value of z-index is small. So when a div layer and a flash object have an intersection on display, how can this div layer be displayed on top of flash?
The following are the solutions I have seen on the Internet.
In fact, you only need to set the flash Object. You do not need to set the z-index attribute value. You only need to set a flash attribute: wmode.
For more information about how
Article Title: new ideas for the development of "Linux compatible kernel project. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Linux has already performed well in the field of servers, embedded systems, and high-performance computing, but it still maintains a low share in the desktop field, especially in the dom
It is very easy to use javascript to determine whether the user clicks the Left or Right button. You only need to add the onmousedown event to the object and use the javascript e. button value to determine whether the user clicks the event. The following is an example.
Document. onmousedown = judgeMouseButton; function judgeMouseButton (e) {var e = window. event | e; // obtain the event object var value = e. button; if (value = 2 | value = 3) {alert ('right-click the click ');} else {alert ('cl
The content of the js verification input box can only contain numbers and numbers with decimal points. Although it is a bit strange on the Internet, it is concise. According to the author's verification, there is no problem in various browsers! The following code is shared as follows:
The first method is to enter only a number and a number with a decimal point. This is correct in IE but not compatible with firefox.
The second method is effective in I
Unknown height div compatible with each browser vertical center effect:It is not as simple to have a div centered vertically with its parent as to have the div centered horizontally in the parent element, as long as it is simple to set margin:0px auto for this element, although some properties can be used in conjunction with a div to be vertically centered with the parent element, but not compatible in some
1. Use Table-cell to achieve center, font-size compatible compatibility ie6+/ff/chromeAdvantages: Do not add any extra tags, compatible with mainstream browsers
The code is as follows
Copy Code
/* Style * *. box-1{display:table;}img-wrap-1{Display:table-cell; width:200px height:200px; border:1px solid #ccc; text-align:center ; Zoom:1; Vertical-align:middle;}/* Height and font-
Article title: Linux compatible kernel 0.2.4 was officially released. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Linux compatible kernel (Longene) version 0.2.4 was officially released. On the basis of version 0.2.3, the new version of the Linux
Compatible with antique IE summary and antique ie Summary
IE6 has been killed. Of course, 7, 8, 9, and 10 are also suspended. Microsoft has made another effort to stop updating IE11. I thought the front-end could write the code with peace of mind. However, some stubborn elements still use IE6 and respect the principle of "customer first", so they are disgusted with providing him with old antiques.
Internet Explorer condition comments, the hack method
Make filezilla compatible with ftpanywhere
FilezillaFTP is a well-known open-source standard FTP client software, but its current version is incompatible with the grid FTP provided by ftpanywhere, currently, it cannot be compatible with the settings provided by it. Therefore, I download its source code snapshot.[2009.4.16] to check whether it is possible to make it comp
In the Web page, the pixel and point ratios are called device-pixel-ratio, and the normal devices are 1,iphone 4 is 2, and some Android models are 1.5. Then-webkit-min-device-pixel-ratio:2 can be used to differentiate between the iphone (4/4S/5) and other phones;The iphone4/4s resolution is 640*960 pixels,dpi is 320*480 and the device height is 480pxIPhone5 resolution of 640*1136 pixels,dpi is still 320*568, the device height is 568pxIPhone6 resolution of 750*1334 pixels,dpi is still 375*667, th
"; ImgDiv.style.height = "127px"; Imgdiv.style.filter= "progid:DXImageTransform.Microsoft.AlphaImageLoader (Sizingmethod = scale)"; ImgDiv.filters.item ("DXImageTransform.Microsoft.AlphaImageLoader"). src = imgfile.value; Newpreview.appendchild (IMGDIV);}The above implementations can run at IE7, 8, 9, and not at IE10, 11. H2. Local picture previews of Firefox and Chrome are used in Firefox and Chrome as follows:var url = window. Url.createobjecturl (document.getElementById (Sourc
DIV+CSS compatible with browser methods such as IE6 IE7 IE8 IE9 and Firefox Chrome1.DOCTYPE affects CSS processing 2. Ff:div set Margin-left, margin-right for Auto is already centered, IE not 3. Ff:body when setting text-align, Div needs to set Margin:auto (mainly margin-left,margin-right) to center 4. FF: After setting the padding, the div will increase the height and width, but IE will not, therefore need to use!important to set a height and width5.
Create an as project compatible with Android studio and EclipseAlthough my blog is called Eclipse_xu, I have not used eclipse for nearly a year, and have already worshipped under Android studio. However, recent projects that are compatible with Eclipse and Android Studio allow some friends who are not yet out of poverty to be able to use the project created by as as well, so we found a way to be
I do the topic is not a lot, but also very bored. In general a special production is 3 days, but debugging 4/5 days. In addition to sales of customers a variety of endless changes to change. It is also important to be browser compatible. At the beginning of the project, the naïve thought that Apple as long as compatible with iphone4,android compatible with the ge
Event object-compatible Processing
1/* 2 * function: event object compatibility 3 * parameter: indicates the event object E4 */5 function getevent (e) {6 7 // If e exists, return directly; otherwise, return window. event8 return E | window. event; 9}
Get the target of the event-compatible Processing
1/* 2 3 * function: Get the target 4 5 * parameter corresponding to the event: the event object E 6 7 */8 9 f
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.