あじちゃんの備忘録。

〜ここはメモ帳です

2018-06-08から1日間の記事一覧

【jQuery】n秒間hoverすると発火する処理

$("#target").mouseenter(function(){ //1秒間hoverしたら表示 timmer = setTimeout(function(){ console.log("SUCCESS!"); },1000); } }).mouseleave(function(){ clearTimeout(timmer); }); ポイント setTimeoutを使う. カーソルが外れた時にclearTimeout…