Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从谷歌获得了 Jquery 插件来检测 JQUERY 的“鼠标按住”事件
$('document').ready(function(){ $('#button').mousehold(function(){ //Do something to implement a spinner }); });
mousehold 工作正常,我如何不断增加文本框的值直到 mousehold 为真,我想实现一个简单的递增微调器
您可以使用此代码使文本框值递增,直到鼠标按住按钮
$(document).ready(function(){ var count = 0; $('#button').mousehold(function(){ $('#spinnerText').val(++count); }); });
文本框如下 -
<input type="text" id="spinnerText">