jQuery mouseup()メソッド
例
<div>要素の上でマウスの左ボタンを離して、テキストを挿入します。
$("div").mouseup(function(){
$(this).after("Mouse button released.");
});
定義と使用法
mouseupイベントは、選択した要素上でマウスの左ボタンを離したときに発生します。
mouseup()メソッドは、mouseupイベントをトリガーするか、mouseupイベントが発生したときに実行する関数をアタッチします。
ヒント:このメソッドは、 mousedown()メソッドと一緒に使用されることがよくあり ます。
構文
選択した要素のmouseupイベントをトリガーします。
$(selector).mouseup()
mouseupイベントに関数をアタッチします。
$(selector).mouseup(function)
Parameter | Description |
---|---|
function | Optional. Specifies the function to run when the mouseup event is triggered |