"JavaScript Advanced Programming Notes-Chapter Nineth: Events"

Source: Internet
Author: User

The 9th chapter: event One, event type
    • IE: bubbling, to document
    • Netscape: Capturing, starting from document
    • Mozilla: Bubble + capture. To Window
    • DOM: Bubbling + capture. Most compatible standard browser to window
Second, the Listener function
    • Ie

      • There are two methods for each element and window object:

        [Object].attachevent (' onclick ', fnhandler); [Object].detachevent (' onclick ', fnhandler);

    • Dom
      • syntax [Object].addeventlistener (' Click ', Fnhandler, false); [Object].removeeventlistener (' Click ', Fnhandler, false);
      • Load and release, must correspond to one by one for bubbling and capturing
Third, the event object
    • Ie
      • is a property of window: window.event
    • Dom
      • Pass the reference
Iv. Comparison of Event objects
    • Default behavior for blocking events
      • IE Event.returnvalue = false;
      • DOM Ev.preventdefault ();
    • Block event bubbling
      • IE event.cancelbubble = true;
      • Mozilla Ev.stoppropagation ();
    • Mouse events
      • SOURCE Node
        • IE:event.srcElement
        • DOM:ev.target
      • MouseOver and Mouseout Event properties
        • Ie:fromelement, Toelement
          • Mouseover:toelement = srcelement
          • Mouseout:fromelement = srcelement
        • DOM:ev.relatedTarget
          • MouseOver: from where
          • Mouseout: Where to go

"JavaScript Advanced Programming Notes-Chapter Nineth: Events"

Related Article

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.