FenXiNspBigScreen/public/layui-v2.7.6/layerex.js

133 lines
4.4 KiB
JavaScript

function layerTips(title,tipID)
{
layer.tips(title, tipID, {
tips: [1, '#78BA32']
});
}
function ShowLayer(title,url){
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.2,
maxmin: true, //开启最大化最小化按钮
//skin: 'layui-layer-nobg', //没有背景色
area: ['893px', '600px'],
content:url
});
}
function ShowLayerHtml(title,content){
layer.open({
type: 1,
title: title,
shadeClose: true,
shade: 0.2,
maxmin: true, //开启最大化最小化按钮
//skin: 'layui-layer-nobg', //没有背景色
area: ['893px', '600px'],
content:content
});
}
function ShowLayer(title,url,width,heigth){
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.2,
maxmin: true, //开启最大化最小化按钮
area: [width+'px', heigth+'px'],
content:url
});
}
function ShowLayerHtml(title,content,width,heigth){
layer.open({
type: 1,
title: title,
shadeClose: true,
shade: 0.2,
maxmin: true, //开启最大化最小化按钮
area: [width+'px', heigth+'px'],
content:content
});
}
function ShowVideoLayer(title,url,width,heigth){
layer.open({
type: 2,
title: title,
area: [width+'px', heigth+'px'],
shade: 0.8,
closeBtn: 0,
skin: 'layui-layer-nobg', //没有背景色
shadeClose: true,
content: ''+url
});
}
function ShowVideoLayerHtml(title,content,width,heigth){
layer.open({
type: 1,
title: title,
area: [width+'px', heigth+'px'],
shade: 0.8,
closeBtn: 0,
skin: 'layui-layer-nobg', //没有背景色
shadeClose: true,
content: content
});
}
//图片放大
layer.ready(function () {
jQuery('.image-zoom').click(function () {
var imgsrc = jQuery(this).attr("src");
var html = '<a href="javascript:void(0);" title="点击查看大图"><img src="' + imgsrc + '" style="cursor:default;width:100%;" /></a>';
parent.layer.open({
title: false,
type: 1,
closeBtn: false,
shadeClose: true,
skin: 'layui-layer-nobg', //没有背景色
area: ['1000px', 'auto'],
content: html
});
});
jQuery('.image-500-zoom').click(function () {
var imgsrc = jQuery(this).attr("src");
var html = '<a href="javascript:void(0);" title="点击查看大图"><img src="' + imgsrc + '" style="cursor:default;width:100%;" /></a>';
parent.layer.open({
title: false,
type: 1,
closeBtn: false,
shadeClose: true,
skin: 'layui-layer-nobg', //没有背景色
area: ['500px', 'auto'],
content: html
});
});
jQuery('.image-300-zoom').click(function () {
var imgsrc = jQuery(this).attr("src");
var html = '<a href="javascript:void(0);" title="点击查看大图"><img src="' + imgsrc + '" style="cursor:default;width:100%;" /></a>';
parent.layer.open({
title: false,
type: 1,
closeBtn: false,
shadeClose: true,
skin: 'layui-layer-nobg', //没有背景色
area: ['300px', 'auto'],
content: html
});
});
jQuery('.image-200-zoom').click(function () {
var imgsrc = jQuery(this).attr("src");
var html = '<a href="javascript:void(0);" title="点击查看大图"><img src="' + imgsrc + '" style="cursor:default;width:100%;" /></a>';
parent.layer.open({
title: false,
type: 1,
closeBtn: false,
shadeClose: true,
skin: 'layui-layer-nobg', //没有背景色
area: ['200px', 'auto'],
content: html
});
});
})