mirror of https://github.com/layui/layui
新增 `util.openWin()` 方法
parent
3a090f6c83
commit
fec0f19515
|
@ -261,6 +261,17 @@ layui.define('jquery', function(exports){
|
||||||
.replace(/\'/g, '\'').replace(/\"/g, '"');
|
.replace(/\'/g, '\'').replace(/\"/g, '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开新窗口
|
||||||
|
,openWin: function(options){
|
||||||
|
var win;
|
||||||
|
options = options || {};
|
||||||
|
win = options.window || window.open((options.url || ''), options.target, options.specs);
|
||||||
|
if(options.url) return;
|
||||||
|
win.document.open('text/html', 'replace');
|
||||||
|
win.document.write(options.content || '');
|
||||||
|
win.document.close();
|
||||||
|
}
|
||||||
|
|
||||||
//让指定的元素保持在可视区域
|
//让指定的元素保持在可视区域
|
||||||
,toVisibleArea: function(options){
|
,toVisibleArea: function(options){
|
||||||
options = $.extend({
|
options = $.extend({
|
||||||
|
|
Loading…
Reference in New Issue