如何在点击空间按钮几秒钟后关闭弹出窗口?
一种可能性是延时关闭参见:
jQuery( document ).ready( function( $ ) {
setTimeout(
function(){
document.querySelector('.dialog-close-button').click();
}, 4000);
});
可能的关闭元素弹出与JavaScript 的转发
我已经在评论中写了它,我也会回答。
Elementor Pro具有用于弹出窗口的JS函数。所以你可以这样称呼它elementorProFrontend.modules.popup.closePopup( { id: yourPopupIdHere } );
总之:
jQuery( document ).ready( function( $ ) {
$( document ).on( 'click', '.close-popup', function( event ) {
setTimeout(function() {
elementorProFrontend.modules.popup.closePopup( {id: yourPopupIdHere}, event )} );
}, 4000);
});
} );
可能有som语法错误,但它应该会给你一个想法