layui弹窗宽度固定高度自适应界面
//默认上下15px的边距高度,可根据需要修改
function layuiDialogFitScreen(){
var layui_title_height=$(window.parent.document).find(".layui-layer-title").height();
var border_margin=30;
var minH=150;
var _margin=0;
var _top=$(window.parent.document).find(".layui-layer-iframe").css("top").split("px")[0];
$("html").height($("body").height());
if($(document).height()+layui_title_height>$(window.parent.document).height()-border_margin){
_margin=-(_top-border_margin/2)+'px';
var mContentH=($(window.parent.document).height()-layui_title_height-border_margin)+'px';
$(window.parent.document).find("iframe").css({"height":mContentH});
$(window.parent.document).find(".layui-layer-iframe").css({"height":mContentH,"top":_top,"margin-top":_margin});
}else{
$(window.parent.document).find("iframe").css("height",($(document).height())+'px');
$(window.parent.document).find(".layui-layer-iframe").css("height",($(document).height())+'px');
if($(document).height()>minH){
_margin=-($(document).height()-minH)/2+'px';
$(window.parent.document).find(".layui-layer-iframe").css("margin-top",_margin);
}
}
} //删除delH高度内容后内容自适应界面高度
function deleteFitView(delH){
var layui_title_height=$(window.parent.document).find(".layui-layer-title").height();
var mH=$("html").height()-delH;
var border_margin=30;
$("html").height(mH);
if( $("html").height()+layui_title_height<=$(window.parent.document).height()-border_margin){
$(window.parent.document).find("iframe").height(mH);
$(window.parent.document).find(".layui-layer-iframe").height(mH);
layuiDialogFitScreen();
} }
layui弹窗宽度固定高度自适应界面的更多相关文章
- layui弹窗里面 session过期 后跳转到登录页面
1.在登录页面添加 <script> $(function () { if (top != window) { layer.msg("登录失效", {icon: 5}) ...
- layui 弹窗中 分页展示table
1. 需求:点击查看更多,展示该类别 所有数据,并分页 2. 参考文档: (1)https://www.jianshu.com/p/40da11ebae66 (2) https://blog.csdn ...
- js中点回车enter触发事件&layui弹窗按enter键不停弹窗问题的解决&js实现鼠标焦点自动落到文本框(layui)
js中回车触发事件 一. document.onkeydown = function (e) { // 回车提交表单 // 兼容FF和IE和Opera var theEvent = window.e ...
- layui 弹窗的iframe 父子界面相互传值
1.父界面向子界面传值 [1].父界面打开子界面: function show_layer(){ layer.open({ type: 2, area: [w+'px', h +'px'], fix: ...
- layui弹窗 之 iframe关闭
1)关闭特定iframe //当在iframe页面关闭自身时,在iframe页执行以下js脚本 var index = parent.layer.getFrameIndex(window.name); ...
- 【layui】获取layui弹窗的index并关闭
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 parent.layer.close(index); // 关闭当前laye ...
- layui弹窗全屏显示
var index =layer.open({ id: 'id', type: 2, area: ['100%', '100%'], fix: false, maxmin: true, shadeCl ...
- layui+croppers完成图片剪切上传
不多说直接上代码: 前台代码: <!DOCTYPE html> <html> <head> <meta charset="utf-8" / ...
- layui插件croppers的使用
这是我第一次在layui环境下面使用croppers插件.先粘贴下前端代码并附上我的目录结构吧. @{ ViewData["Title"] = "Crop ...
随机推荐
- python select poll
http://www.cnblogs.com/coser/archive/2012/01/06/2315216.html
- Selenium的PageFactory & PageObject 在大型项目中的应用
因为最近遇到的技术问题一直没找到可行的解决办法,一直在翻看selenium的源代码,之前写测试代码的时候就是拿来即用,写什么功能啊,就按手动的操作步骤去转换,近日看到一个文章,又去wiki上查了查,觉 ...
- Spring-1-I 233 Matrix(HDU 5015)解题报告及测试数据
233 Matrix Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Descript ...
- cx_Oracle连接数据库总结
python中连接oracle数据库使用第三方库文件cx_Oracle时遇到了各种问题,网上查找资料调试了几天才弄好,下面是不断调试后总结的一些经验.1.oracle客户端(Oracle Instan ...
- java 2017/6/26杂记
mkdirs()可以建立多级文件夹, mkdir()只会建立一级的文件夹, 如下: new File("/tmp/one/two/three").mkdirs(); 执行后, 会建 ...
- mysql 手动安装和管理
版本:5.7.10 my.ini简单配置 [client] default-character-set=utf8 [mysqld] port = 3306 basedir =D:/programs/M ...
- php 输出 sql语句
第一种方法 $data = M('news')->field("title,date_format(postdate,'%Y-%m-%d') as postdate,content&q ...
- Spark机器学习9· 实时机器学习(scala with sbt)
1 在线学习 模型随着接收的新消息,不断更新自己:而不是像离线训练一次次重新训练. 2 Spark Streaming 离散化流(DStream) 输入源:Akka actors.消息队列.Flume ...
- Web安全学习笔记之Kali部署DVWA和OWASPBWA
0x0 前言 kali安装完成,下面要进行实战操作了,喵~~(OWASPBWA请直接跳到第八部分) #既然你诚心诚意的问了,我们就大发慈悲的告诉你! #为了防止世界被破坏! #为了守护世界的和平! # ...
- 20145303《Java程序设计》实验三实验报告
20145303<Java程序设计>实验三实验报告 ssh公钥配置及git安装: eclipse中git配置: 队友链接: http://www.cnblogs.com/5321z/p/5 ...