我有一个jquery函数,我需要延迟1秒。 我在这里搜索过,我需要使用settimeout函数,我不知道如何放入jquery。
这是我的代码:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.animacao').addClass("hidden").viewportChecker({
classToAdd: 'visible animated fadeInDown', // Class to add to the elements when they are visible
offset: 100
});
});
</script>
有人可以帮助我吗?
答案 0 :(得分:2)
在setTimeout
setTimeout(function() {
jQuery('.animacao').addClass("hidden").viewportChecker({
classToAdd: 'visible animated fadeInDown', // Class to add to the elements when they are visible
offset: 100
});
}, 1000); //the delay is set in milliseconds... 1000ms = 1 second