pull/3/head
sentsin 2014-05-28 00:02:27 +08:00
parent 863e5009d0
commit f162537ce1
3 changed files with 46 additions and 47 deletions

View File

@ -1,4 +1,8 @@
【1.8.1更新日志】2014-5-16 【1.8.2更新日志】2014-5-27
1、优化核心代码
2、修复了两个潜在的小小小bug
【1.8.1更新日志】2014-5-16
1、紧急修复ie7下无法显示关闭按钮的bug 1、紧急修复ie7下无法显示关闭按钮的bug
2、紧急修复ie6最小化按钮高度稍微溢出的bug 2、紧急修复ie6最小化按钮高度稍微溢出的bug
3、去掉layer.css的reset以避免可能存在的样式冲突 3、去掉layer.css的reset以避免可能存在的样式冲突

View File

@ -1,13 +1,13 @@
/************************************************************** /**************************************************************
@Name: layer v1.8.1 弹层组件开发版 @Namelayer v1.8.2 弹层组件开发版
@Author: 贤心 @Author贤心
@Date: 2014-05-19 @Date2014-05-27
@Blog: http://sentsin.com @Bloghttp://sentsin.com
@QQ群78803422 (layer组件群3) @QQ群78803422 (layer组件群3)
@Copyright: Sentsin Xu(贤心) @CopyrightSentsin Xu(贤心)
@官网http://sentsin.com/jquery/layer @官网http://sentsin.com/jquery/layer
@授权: http://item.taobao.com/item.htm?id=37295654589 @授权http://url.cn/RAejZY
*************************************************************/ *************************************************************/
@ -15,28 +15,23 @@
"use strict"; "use strict";
var pathType = true, //是否采用自动获取绝对路径。false将采用下述变量中的配置 var pathType = true, //是否采用自动获取绝对路径。false将采用下述变量中的配置
pathUrl = 'lily/lib/layer/', //上述变量为false才有效当前layerjs所在目录(不用填写host相对站点的根目录即可)。 pathUrl = '/lily/lib/layer/', //上述变量为false才有效当前layerjs所在目录(不用填写host相对站点的根目录即可)。
$, win, ready = { $, win, ready = {
hosts: (function(){ host: 'http://' + location.host,
var dk = location.href.match(/\:\d+/);
dk = dk ? dk[0] : '';
return 'http://' + document.domain + dk + '/';
}()),
getPath: function(){ getPath: function(){
var js = document.scripts, jsPath = js[js.length - 1].src; var js = document.scripts, jsPath = js[js.length - 1].src;
if(pathType){ if(pathType){
return jsPath.substring(0, jsPath.lastIndexOf("/") + 1); return jsPath.substring(0, jsPath.lastIndexOf("/") + 1);
} else { } else {
return this.hosts + pathUrl; return this.host + pathUrl;
} }
} }
}; };
//默认内置方法。 //默认内置方法。
window.layer = { window.layer = {
v : '1.8.1', //版本号 v : '1.8.2', //版本号
ie6: !-[1,] && !window.XMLHttpRequest, ie6: !-[1,] && !window.XMLHttpRequest,
index: 0, index: 0,
path: ready.getPath(), path: ready.getPath(),
@ -49,11 +44,11 @@ window.layer = {
var node = document.createElement(iscss ? 'link' : 'script'); var node = document.createElement(iscss ? 'link' : 'script');
var id = module.replace(/\.|\//g, ''); var id = module.replace(/\.|\//g, '');
if(iscss){ if(iscss){
node.setAttribute('type', 'text/css'); node.type = 'text/css';
node.setAttribute('rel', 'stylesheet'); node.rel = 'stylesheet';
} }
node.setAttribute((iscss ? 'href' : 'src'), /^http:\/\//.test(module) ? module : layer.path + module); node[iscss ? 'href' : 'src'] = /^http:\/\//.test(module) ? module : layer.path + module;
node.setAttribute('id', id); node.id = id;
if(!$('#'+ id)[0]){ if(!$('#'+ id)[0]){
head.appendChild(node); head.appendChild(node);
} }
@ -226,7 +221,7 @@ Class.pt.space = function(html){
}; };
//缓存字符 //缓存字符
Class.pt.dom = { ready.dom = Class.pt.dom = {
lay: 'xubox_layer', lay: 'xubox_layer',
ifr: 'xubox_iframe', ifr: 'xubox_iframe',
title: '.xubox_title', title: '.xubox_title',
@ -778,30 +773,13 @@ Class.pt.openLayer = function(){
typeof ready.config.end[index] === 'function' && ready.config.end[index](); typeof ready.config.end[index] === 'function' && ready.config.end[index]();
delete ready.config.end[index]; delete ready.config.end[index];
}; };
//关闭加载层 //关闭加载层
layer.closeLoad = function(){ layer.closeLoad = function(){
var parent = $('.xubox_loading').parents('.'+dom.lay), var parent = $('.xubox_loading').parents('.'+dom.lay),
index = parent.attr('times'); index = parent.attr('times');
layer.close(index); layer.close(index);
}; };
//关闭tips层
layer.closeTips = function(){
var tips = $('.xubox_tips');
if(tips[0]){
layer.close(tips.parents('.xubox_layer').attr('times'));
}
};
//关闭所有层
layer.closeAll = function(){
var layerObj = $('.'+dom.lay);
$.each(layerObj, function(){
var i = $(this).attr('times');
layer.close(i);
});
};
//出场内置动画 //出场内置动画
layer.shift = function(type, rate, stop){ layer.shift = function(type, rate, stop){
@ -884,6 +862,23 @@ Class.pt.openLayer = function(){
}; };
}; };
//关闭tips层
layer.closeTips = function(){
var tips = $('.xubox_tips');
if(tips[0]){
layer.close(tips.parents('.xubox_layer').attr('times'));
}
};
//关闭所有层
layer.closeAll = function(){
var layerObj = $('.'+ready.dom.lay);
$.each(layerObj, function(){
var i = $(this).attr('times');
layer.close(i);
});
};
//主入口 //主入口
ready.run = function(){ ready.run = function(){
$ = jQuery; $ = jQuery;

16
layer/layer.min.js vendored

File diff suppressed because one or more lines are too long