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