Use Firefox variables to represent Firefox agents
var Firefox = navigator.userAgent.indexOf (' Firefox ')! =-1;
function MouseWheel (e) {//block event bubbling and the default behavior of the full compatibility code
E = e| | window.event;
if (e.stoppropagation) {//This is to cancel bubbling
E.stoppropagation ();
} else{
E.cancelbubble = true;
};
if (E.preventdefault) {//This is the cancellation of the default behavior, it is not one thing to be clear about canceling the default behavior and bubbling
E.preventdefault ();
} else{
E.returnvalue = false;
};
}
var con = document.getElementById (' content ');//To scroll inside the content, and the page is not affected, so here gets the object to scroll
If FF binds the Dommousescroll event, the other browser is triggered with the OnMouseWheel event
Firefox? Con.addeventlistener (' Dommousescroll ', Mousewheel,false): (Con.onmousewheel = MouseWheel);
The anti-bubble, block default behavior of the wheel event code (effect: only the current Div scrolls, even the current document does not scroll)