scroll bar distance (compatible under some browsers)
Document.documentElement.scrollTop | | Document.body.scrollTop
Event Monitoring implementation compatible:
if (Elem.addeventlistener) {
Elem.addeventlistener ("click", fn)
}else{
Elem.attachevent ("onclick", FN);
}
Event Object
var ev=ev| | window.event;
Returns the object on which the mouse was triggered when the event was fired
var ele = Event.srcelement | | Event.target;
Cancel bubbling
if (event.stoppropagation) {
Event.stoppropagation (); Standard browser
}else{
Event.cancalebubble==true; Old IE
}
Block browser default behavior
function Preventdefa (e) {
if (window.event) {
How to block the default action of a function in IE
Window.event.returnValue = false;
}
else{
Block default browser action (web)
E.preventdefault ();
}
}
Block browser default behavior (high version)
return false; All triggering events and actions are not executed. Can be used to replace Preventdefault
js--compatible notation