gpt4 book ai didi

javascript - 显示模式弹出基础 : Prevent close on popup

转载 作者:搜寻专家 更新时间:2023-11-01 05:00:42 25 4
gpt4 key购买 nike

我正在使用显示模态弹出窗口 http://foundation.zurb.com/docs/components/reveal.html .

是否有内置方法来防止关闭 esc 键上的弹出窗口。或者我怎样才能让它发挥作用?

我尝试了以下,

    $(document).keyup(function(e) {
if (e.keyCode === 27) {
return e.preventDefault();
}
});

打开弹出窗口的链接

    <a class="action icon-primary" id="manageAccess" ng-click="Popup()"><img src="images/Manage_Access_Icon.svg"/>Access Pop up</a>

弹出窗口

    <div id="AccessContainer" class="reveal-modal large" data-reveal data-options="close_on_background_click:false;">
//contents inside pop-up
<a class="close-reveal-modal">&#215;</a> // wil close pop-up
</div>

$scope.Popup = function() {
return $("#AccessContainer").foundation("reveal", "open");
};

在 foundation.reveal.js 中

settings : {
animation: 'fadeAndPop',
animation_speed: 250,
close_on_background_click: true,
close_on_esc: true, // how can i change this from my js
dismiss_modal_class: 'close-reveal-modal',
bg_class: 'reveal-modal-bg',
open: function(){},
opened: function(){},
close: function(){},
closed: function(){},
bg : $('.reveal-modal-bg'),
css : {
open : {
'opacity': 0,
'visibility': 'visible',
'display' : 'block'
},
close : {
'opacity': 1,
'visibility': 'hidden',
'display': 'none'
}
}
}

但还是不行。

请帮忙,谢谢。

最佳答案

终于找到了:

data-options="close_on_background_click:false;close_on_esc:false;"

关于javascript - 显示模式弹出基础 : Prevent close on popup,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26667464/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com