我有以下代码,如果行存在,如何打开另一个页面作为模式窗口弹出窗口?
function editLesson(){
var row = $('#dg').datagrid('getSelected');
if (row){
// would like to open another page as modal window
}
}
任何帮助都非常值得赞赏。
最佳答案
你可以使用 fancybox 插件。这是一个非常棒的插件。 http://fancybox.net/ (注意 fancybox 2 也已退出)
http://jsfiddle.net/kasperfish/5EV8r/109/
$.fancybox('hello');
您还可以在 fancybox(模态)窗口中加载 iframe http://jsfiddle.net/kasperfish/5EV8r/110/
$.fancybox([
'url'//url to your page
], {
'padding' : 10,
'type' : 'iframe',//set type to iframe
'overlayOpacity' : 0.7,
'overlayColor' : 'black',
'speedIn' : 900,
'speedOut' : 400,
'width' : '70%',
'height' : '50%'
});
关于javascript - 打开一个新页面作为模态窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19123240/