Read & lt; jquery authoritative guide & gt; [2]-Events

Source: Internet
Author: User

  • Type is a string of one or more event types. data is an additional object that is passed to the event object as the event. data Attribute Value.

    • An element is bound to multiple events and can be separated by spaces.

    Click mouseover", Function (){...);

    • Bind multiple events to the same element by ing.
    $ (Function () {$ (". txt "). bind ({"focus": function () {$ ("# divTip" ).html ("enter "). show () ;}, "blur": function () {$ ("# divTip "). show (). html ("valid ");}});});

     

    • Use of the second parameter data.
         info = { name: 'Cathy', date: '2014-1-24'"#test").bind("click", info, "#divTip").show().html(event.data.name + "," +
    • Hover: switches between hover and remove.
        $(".clsTitle"".clsContent"".clsContent"
    • Toggle: Calls N functions sequentially. After the last call is completed, it is executed in turn from the first one.
        $("#divTest"123

    Parameter description: type is the event type to be removed, and func is the event handler function to be removed. If func is empty, all events of the element are removed.

    "# DivTip "). append ("Click 2" "# Button1 "). click ("# divTip "). append ("Click 1" "# Button2" "# Button3 "). click ("input "). unbind ("click"
    Parts

    One (type, [data], func) -- events that are executed only once for element binding.

    Trigger (type, [data]) -- triggers an event of the specified type on the selected element.

    $( i = 1.value = i++"input").one("click""input").bind("click""input").trigger("click"

    ① Tab Effect

    Home appliances used I am home content welcome you to the electric city used market, rich and colorful productsHtml Body
      

    ② Screen middle pop-up screen mask

    This is a record that can be deleted. Do you really want to delete this record?Html
                                                                                                                                   

    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.