Custombox 给定以下代码,我可以通过第一次调用openCommandDialog打开#dialog,但是,在第二次调用该方法后发生错误。我想知道是否有正确的方法来打开对话框。
错误:
Uncaught TypeError: Cannot read property 'settings' of undefined
at Object.c.set (http://localhost:58139/Scripts/custombox/custombox.min.js:10:1283)
at Object.open (http://localhost:58139/Scripts/custombox/custombox.min.js:10:14706)
at <anonymous>:2:11
at Object.InjectedScript._evaluateOn (<anonymous>:905:140)
at Object.InjectedScript._evaluateAndWrap (<anonymous>:838:34)
at Object.InjectedScript.evaluate (<anonymous>:694:21)c.set @ custombox.min.js:10open @ custombox.min.js:10(anonymous function) @ VM312:2InjectedScript._evaluateOn @ VM267:905InjectedScript._evaluateAndWrap @ VM267:838InjectedScript.evaluate @ VM267:694
代码:
function openCommonDialog() {
$(function () {
Custombox.open({
target: '#dialog',
effect: 'slide',
overlayEffect: 'fadein',
overlayClose: false,
animation: ['bottom', 'top'],
position: ['center', 'center'],
speed: 250
});
});
}