jQuery ユーザーマニュアル (6)_jquery
hover(Function, Function) 当鼠标move over时触发第一个function,当鼠标move out时触发第二个function
样式:
Html代码:
jQuery代码及效果
$("#a").hover(function(){$(this).addClass("red");},
function(){ $(this).removeClass("red");
});
})
toggle(Function, Function) 当匹配元素第一次被点击时触发第一个函数,当第二次被点击时触发第二个函数
样式:
Html代码:
jQuery代码及效果
$("#a"). toggle (function(){$(this).addClass("red");},
function(){ $(this).removeClass("red");
});
})
bind(type, fn) The user will The event and the way the event is triggered are bound to the matching object.
trigger(type) The user triggers an event in the form of type. $("p").trigger("click")
Also:unbind() unbind(type) unbind(type, fn)
Dynamic event(Function) A shortcut way to bind and unbind provided functions
Example:
).addClass("red");}) can also be written like this :
$(
The final effect is that when the mouse clicks on the layer with id a, the layer adds a red style. The function provided by jQuery is used for browsers eventerror(fn) load(fn) unload(fn) resize(fn) scroll(fn)
for form event
change(fn) select(fn) submit(fn)
for keyboard event
keydown
(fn) keypress(fn) keyup(fn)
for mouse event
click(fn) dblclick(fn) mousedown(fn ) mousemove(fn)
mouseout(fn) mouseover(fn) mouseup(fn)
Used for UI eventsblur(fn) focus(fn)
The expansion of the above events is further expanded to 5 categories
For example, click(fn) extends click() unclick() oneclick(fn) unclick(fn)click(fn): Add an event that triggers a function when clickedclick(): Matching can be performed in other events The click event of the object.
unclick (): Do not execute the click event of the matching object. oneclick(fn): Only add a click event that can be executed once.
unclick (fn): Add an event that does not trigger a function when clicked. The events listed above for browsers, forms, keyboards, mice, and UI can all be expanded according to the above methods.

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック











jQueryでPUTリクエストメソッドを使用するにはどうすればよいですか?

jQuery のヒント: ページ上のすべての a タグのテキストをすばやく変更する

jQuery を使用してすべての a タグのテキスト コンテンツを変更する

DingTalk PC版ユーザーマニュアルの見方 - DingTalk PC版ユーザーマニュアルの見方

jQuery 要素に特定の属性があるかどうかを確認するにはどうすればよいですか?
