Scroll wheel controls Image Scaling

Source: Internet
Author: User
When you use the scroll wheel to interact with the page and scroll the page vertically (both downward and upward), The mousewheel event is triggered. This event can be triggered on any element and will eventually bubble to the document (IE) or window (opera, chrome, and Safari) object. The mousewheel event is triggered in IE. Dommousescroll event triggered in Firefox. You can bind two events to the element in use. Use E. preventdefault () in the standard browser; then cancel the bubble E. stoppropagation. If E. preventdefault () is used directly, an error is reported in IE. This method is not supported. Therefore, a judgment is required. If (E. preventdefault) {e. preventdefault ()} ie earlier versions do not support this method. Use returnvalue = flase to prevent default events. Use return false with caution;
Getwheeldelta:Function(Event ){If(Event. wheeldelta) {// The IE browser returns the plus or minus 120ReturnEvent. wheeldelta ;}Else{// The standard browser returns Positive and Negative 3Return-Event. Detail * 4;}}

 

Demo:

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.