arale-overlay
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -18,2 +18,3 @@ # 基本浮层及其定位 | ||
</style> | ||
<script src="../spm_modules/jquery/1.7.2/jquery.js?nowrap"></script> | ||
@@ -28,22 +29,21 @@ ## 1. 基本浮层 | ||
````javascript | ||
seajs.use('overlay', function(Overlay) { | ||
var o = new Overlay({ | ||
template: "<div class='overlay'>目标元素1</div>", | ||
parentNode: '#c', | ||
id: 'myoverlay', | ||
style: { | ||
color: '#fff' | ||
}, | ||
align: { | ||
selfXY: ['-100%', 0], | ||
baseElement: '#a', | ||
baseXY: [0, 0] | ||
} | ||
}); | ||
o.show(); | ||
o.set('style', { | ||
backgroundColor: '#f53379' | ||
}); | ||
o.set('height', 40); | ||
var Overlay = require('arale-overlay'); | ||
var o = new Overlay({ | ||
template: "<div class='overlay'>目标元素1</div>", | ||
parentNode: '#c', | ||
id: 'myoverlay', | ||
style: { | ||
color: '#fff' | ||
}, | ||
align: { | ||
selfXY: ['-100%', 0], | ||
baseElement: '#a', | ||
baseXY: [0, 0] | ||
} | ||
}); | ||
o.show(); | ||
o.set('style', { | ||
backgroundColor: '#f53379' | ||
}); | ||
o.set('height', 40); | ||
```` | ||
@@ -57,12 +57,11 @@ ## 2. 全局定位浮层 | ||
````javascript | ||
seajs.use('overlay', function(Overlay) { | ||
var o2 = new Overlay({ | ||
element: '#b', | ||
width: 100, | ||
align: { | ||
baseXY: [200, 0] | ||
} | ||
}); | ||
o2.show(); | ||
var Overlay = require('arale-overlay'); | ||
var o2 = new Overlay({ | ||
element: '#b', | ||
width: 100, | ||
align: { | ||
baseXY: [200, 0] | ||
} | ||
}); | ||
o2.show(); | ||
```` | ||
@@ -79,35 +78,35 @@ | ||
````javascript | ||
seajs.use(['overlay', 'jquery'], function(Overlay, $) { | ||
var testPopup = Overlay.extend({ | ||
attrs : { | ||
trigger: null | ||
}, | ||
setup: function() { | ||
var that = this; | ||
testPopup.superclass.setup.call(this); | ||
this._setPosition(); | ||
$(this.get('trigger')).click(function() { | ||
that.show(); | ||
}); | ||
// 需要调用这句话来实现功能 | ||
this._blurHide(this.get('trigger')); | ||
} | ||
}); | ||
new testPopup({ | ||
trigger: '#d1_trigger', | ||
element: '#d1', | ||
align: { | ||
baseElement: '#d1_trigger', | ||
baseXY: ['100%', 0] | ||
} | ||
}); | ||
new testPopup({ | ||
trigger: '#d2_trigger', | ||
element: '#d2', | ||
align: { | ||
baseElement: '#d2_trigger', | ||
baseXY: ['100%', 0] | ||
} | ||
}); | ||
var $ = require('spm-jquery'); | ||
var Overlay = require('arale-overlay'); | ||
var testPopup = Overlay.extend({ | ||
attrs : { | ||
trigger: null | ||
}, | ||
setup: function() { | ||
var that = this; | ||
testPopup.superclass.setup.call(this); | ||
this._setPosition(); | ||
$(this.get('trigger')).click(function() { | ||
that.show(); | ||
}); | ||
// 需要调用这句话来实现功能 | ||
this._blurHide(this.get('trigger')); | ||
} | ||
}); | ||
new testPopup({ | ||
trigger: '#d1_trigger', | ||
element: '#d1', | ||
align: { | ||
baseElement: '#d1_trigger', | ||
baseXY: ['100%', 0] | ||
} | ||
}); | ||
new testPopup({ | ||
trigger: '#d2_trigger', | ||
element: '#d2', | ||
align: { | ||
baseElement: '#d2_trigger', | ||
baseXY: ['100%', 0] | ||
} | ||
}); | ||
```` | ||
@@ -114,0 +113,0 @@ |
@@ -11,2 +11,4 @@ # 全局遮罩Mask组件示例 | ||
<script src="../spm_modules/jquery/1.7.2/jquery.js?nowrap"></script> | ||
## 默认遮罩层 | ||
@@ -17,13 +19,12 @@ | ||
````javascript | ||
seajs.use(['jquery', 'src/mask'], function($, mask) { | ||
$('#a').click(function() { | ||
mask.show(); | ||
}); | ||
$(document).keyup(function(e) { | ||
// keyboard esc | ||
if (e.keyCode === 27) { | ||
mask.hide(); | ||
} | ||
}); | ||
var mask = require('arale-overlay').Mask; | ||
$('#a').click(function() { | ||
mask.show(); | ||
}); | ||
$(document).keyup(function(e) { | ||
// keyboard esc | ||
if (e.keyCode === 27) { | ||
mask.hide(); | ||
} | ||
}); | ||
```` | ||
@@ -42,7 +43,6 @@ | ||
````javascript | ||
seajs.use(['jquery', 'src/mask'], function($, mask) { | ||
$('#b').click(function() { | ||
mask.set('backgroundColor', 'green').set('opacity', '0.3').show(); | ||
}); | ||
var mask = require('arale-overlay').Mask; | ||
$('#b').click(function() { | ||
mask.set('backgroundColor', 'green').set('opacity', '0.3').show(); | ||
}); | ||
```` |
@@ -7,2 +7,6 @@ # 历史 | ||
`FIXED` 按照spm@3.9的规范升级组件。 | ||
## 1.2.0 | ||
`CHANGED` 按照 spm@3.x 规范升级。 | ||
@@ -9,0 +13,0 @@ |
{ | ||
"name": "arale-overlay", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "基础浮层组件,提供浮层显示隐藏、定位和 select 遮挡等特性。", | ||
@@ -26,6 +26,6 @@ "keywords": [ | ||
"dependencies": { | ||
"arale-iframe-shim": "1.1.0", | ||
"arale-widget": "~1.2.0", | ||
"spm-jquery": "1.7.2", | ||
"arale-widget": "1.2.0", | ||
"spm-position": "1.1.0", | ||
"arale-iframe-shim": "1.1.0" | ||
"spm-position": "1.1.0" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
@@ -6,6 +6,5 @@ # Overlay | ||
[](http://spmjs.io/package/arale-overlay) | ||
[](https://travis-ci.org/aralejs/overlay) | ||
[](https://coveralls.io/r/aralejs/overlay) | ||
[](https://travis-ci.org/aralejs/overlay) | ||
[](https://coveralls.io/r/aralejs/overlay) | ||
基础浮层组件,提供浮层显示隐藏、定位和 IE6 下 select 遮挡、窗口 resize 时重新定位、点击页面空白处浮层消失等等特性,是所有浮层类组件的基类。 | ||
@@ -177,6 +176,1 @@ | ||
``` | ||
[](https://bitdeli.com/free "Bitdeli Badge") | ||
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11
28045
175
1
+ Addedarale-widget@1.2.1(transitive)
- Removedarale-widget@1.2.0(transitive)
Updatedarale-widget@~1.2.0