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 web中的文件上传与下载
django 框架下 实现服务端的文件上传与下载: import jsonimport osimport uuid def attachment_upload(request): "&quo ...
- Spring第六弹—-依赖注入之使用构造器注入与使用属性setter方法注入
所谓依赖注入就是指:在运行期,由外部容器动态地将依赖对象注入到组件中. 使用构造器注入 1 2 3 4 <constructor-arg index=“0” type=“java.lang. ...
- PAT 1144 The Missing Number[简单]
1144 The Missing Number(20 分) Given N integers, you are supposed to find the smallest positive integ ...
- matplotlib 的 subplot, axes and axis
fig = plt.figure('多图', (10, 10), dpi=80) #第一个指定窗口名称,第二个指定图片大小,创建一个figure对象 plt.subplot(222) #2*2的第二个 ...
- fiddler操作改到本地
urlreplace test5.api.bookapi.cn:8889 localhost:8080
- iOS 所有设备一览 && CoreFoundation源码
1. 所有设备一览 https://en.wikipedia.org/wiki/List_of_iOS_devices 2. CoreFoundation源码(可以看看runloop.runtime的 ...
- Python 实例3—三级菜单
老男孩培训学习: ''' Author:Ranxf ''' menu = { '北京': { '海淀': { '五道口': { 'soho': {}, '网易': {}, 'google': {} } ...
- 20145216史婧瑶《Java程序设计》第四次实验报告
实验四 Android环境搭建 实验内容 搭建Android环境 运行Android 修改代码,能输出学号 实验步骤 1.搭建Android环境 2.安装Android,核心是配置JDK.SDK 3. ...
- MysQL使用一高级应用(上)
简介 实体与实体之间有3种对应关系,这些关系也需要存储下来 在开发中需要对存储的数据进行一些处理,用到内置的一些函数 视图用于完成查询语句的封装 事务可以保证复杂的增删改操作有效 关系 创建成绩表sc ...
- backstopJS 参数详解 CN
最近需要进行前端UI验证,详细研究了下backstopJS.官方文档为En,手动翻译了下.相关参数信息如下: 如需转载引用,请保留原文出处,支持原创,感谢.