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
請提供小提琴,以更好地理解。 –