mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-31 19:30:07 +00:00
added options...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e29b2143ae
commit
411ed26a25
@ -41,6 +41,10 @@ var OverlayPrototype = {
|
|||||||
client: null,
|
client: null,
|
||||||
|
|
||||||
options: {
|
options: {
|
||||||
|
'close-at': 10,
|
||||||
|
'fade-at': 100,
|
||||||
|
'animate': 120,
|
||||||
|
|
||||||
nonPropagatedEvents: [
|
nonPropagatedEvents: [
|
||||||
'click',
|
'click',
|
||||||
'keydown',
|
'keydown',
|
||||||
@ -78,7 +82,7 @@ var OverlayPrototype = {
|
|||||||
opacity: 0,
|
opacity: 0,
|
||||||
filter: 'none',
|
filter: 'none',
|
||||||
},
|
},
|
||||||
120,
|
this.options['animate'],
|
||||||
function(){
|
function(){
|
||||||
that.dom.detach()
|
that.dom.detach()
|
||||||
if(that.parent.children('.overlay-widget').length == 0){
|
if(that.parent.children('.overlay-widget').length == 0){
|
||||||
@ -127,14 +131,15 @@ var OverlayPrototype = {
|
|||||||
client_dom.outerHeight(),
|
client_dom.outerHeight(),
|
||||||
// do not scroll more than the container height and
|
// do not scroll more than the container height and
|
||||||
// keep a bit on top...
|
// keep a bit on top...
|
||||||
(parent.is('body') ? $(document) : parent).outerHeight()-100)+'px',
|
(parent.is('body') ? $(document) : parent)
|
||||||
|
.outerHeight()-options['fade-at'])+'px',
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
120,
|
options['animate'],
|
||||||
function(){
|
function(){
|
||||||
dom.scroll(function(){
|
dom.scroll(function(){
|
||||||
var st = $(this).scrollTop()
|
var st = $(this).scrollTop()
|
||||||
var h = Math.min(100, client_dom.outerHeight())
|
var h = Math.min(options['fade-at'], client_dom.outerHeight())
|
||||||
// start fading...
|
// start fading...
|
||||||
if(st < h){
|
if(st < h){
|
||||||
dom.css({ opacity: Math.min(1, st/h) })
|
dom.css({ opacity: Math.min(1, st/h) })
|
||||||
@ -142,7 +147,7 @@ var OverlayPrototype = {
|
|||||||
dom.css('opacity', 1)
|
dom.css('opacity', 1)
|
||||||
}
|
}
|
||||||
// close drawer when scrolling to the top...
|
// close drawer when scrolling to the top...
|
||||||
if(st < 10){
|
if(st < options['close-at']){
|
||||||
that.close()
|
that.close()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user