Home > Web Front-end > JS Tutorial > Summary of quirks of different browsers_javascript tips

Summary of quirks of different browsers_javascript tips

WBOY
Release: 2016-05-16 18:23:16
Original
917 people have browsed it

1. When setting the div top and left, they must be set together, otherwise the object will disappear, and the description layer postion is set to fixed

document.getElementById("mydiv").style.top=10 "px";

document.getElementById("mydiv").style.left=10 "px";

There is no such problem when tested under chrome



2. Get the page The height and width of the part being viewed.

IE8 can only use document.documentElement.Height/Width

Chrome can use window.innerHeight/innerEidth or the above



3. Mouse pointer

You can customize the mouse pointer under IE and add url, cursor:url("move.cur");

You need to add it at the end under chrome on, autocursor:url("move.cur"),auto;



4.javascript address bar dynamic output (when opening any web page, enter javascript:void( (function(){ })())) execute a piece of code)

For example, if you want to output a layer and write document.write directly, nothing will be displayed

You can only use var obj=document .createElement("div");

obj.style set one by one

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template