2
我的工作中,我要显示每个图像收藏画廊后 - 所以我想在收藏夹如何显示在几秒钟后引导收藏夹点击
有没有办法做到这一点有些延迟?
代码:
$(document).on('click', '.varr', function() {
var post_id = $(this).attr('data-id');
$.ajax({
url: "<?php echo get_template_directory_uri(); ?>/post-result.php",
type: 'POST',
dataType: "html",
data: {
post_id: post_id
},
success: function(response) {
//$('#loaddata').html(response);
$('#loaddata').html(response);
// alert(response)
}
});
setTimeout(function() {
$('.remodal').modal('hide');
}, 3000);
})
你已经在使用'setTimeout'了 - 你不能再使用它吗?将'$ .ajax'放入setTimeout中,或将$(“#loaddata”)...放在一个中。 –
我只是想settimeout函数,但它不工作 – varsha
请提供小提琴,以更好地理解。 –