want to auto click cancel in prompt in firefox

…衆ロ難τιáo~ 提交于 2019-12-06 21:17:41
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
$(".popup").bind('show',function(){
    $(this).hide();
});

may work, depends on the popup type. if it doesn't work, try this:

// @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
$(".popup").bind('show',function(){
    $(".popup .cancel).trigger("click");
});

[if JQuery wasn't successfully installed in your script previously, you'll need to uninstall your script and reinstall it]

edit: for imitation of pressing escape, use

// @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
var esc = $.Event("keydown", {
keyCode: 27
});
$(".popup").bind('show',function(){
    $('body').trigger(esc);
});
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!