我使用的是以下代码:
function resizeJquerySteps() {
$('.wizard .content').animate({
height: $('.body.current').outerHeight()
}, 'slow');
}
$(window).resize($.debounce(250, resizeJquerySteps));接收到这个错误TypeError: $.debounce is not a function,有没有其他方法可以写出这个没有错误的代码?
发布于 2017-07-19 22:03:50
此函数定义在一些库中,如下面的http://benalman.com/code/projects/jquery-throttle-debounce/jquery.ba-throttle-debounce.js
您需要将该库包含到您的项目中。请参阅此处的示例http://jsfiddle.net/hYsRh/4/
$(window).scroll($.debounce( 250, true, function(){
$('#scrollMsg').html('SCROLLING!');
} ) );发布于 2021-10-26 06:44:18
在中添加了以下脚本:
<script src="http://benalman.com/code/projects/jquery-throttle-debounce/jquery.ba-throttle-debounce.js"></script>和js代码是:-
$("#confirmNewPassword").on("keyup keypress",($.debounce(500, function () { console.log("working debauncing")})))希望这也能为你工作。谢谢。
https://stackoverflow.com/questions/37730628
复制相似问题