mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 02:40:08 +00:00
some rough polish applied......
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e326543d06
commit
09be2834b7
@ -352,6 +352,18 @@ function focusBelowRibbon(){
|
|||||||
|
|
||||||
/********************************************************** Helpers **/
|
/********************************************************** Helpers **/
|
||||||
|
|
||||||
|
function doWithoutTransitions(obj, func){
|
||||||
|
obj
|
||||||
|
.addClass('unanimated')
|
||||||
|
.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){
|
||||||
|
func()
|
||||||
|
$('.viewer')
|
||||||
|
.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){
|
||||||
|
obj.removeClass('unanimated')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// find an image object after which to position image ID...
|
// find an image object after which to position image ID...
|
||||||
// used for two main tasks:
|
// used for two main tasks:
|
||||||
// - positioning promoted/demoted images
|
// - positioning promoted/demoted images
|
||||||
@ -472,23 +484,30 @@ function createRibbon(direction){
|
|||||||
// ...this can be systematically solved by adding a clickCurrent
|
// ...this can be systematically solved by adding a clickCurrent
|
||||||
// function that will wait till the animations are done...
|
// function that will wait till the animations are done...
|
||||||
|
|
||||||
// need to account for increased top when creating a ribbon above...
|
$('.field').addClass('unanimated')
|
||||||
// i.e. shift the content upward...
|
|
||||||
if(direction == 'prev'){
|
//doWithoutTransitions($('.field'), function(){
|
||||||
$('.field').css({
|
// need to account for increased top when creating a ribbon above...
|
||||||
'margin-top': parseInt($('.field').css('margin-top')) - $('.current.ribbon').outerHeight()
|
// i.e. shift the content upward...
|
||||||
})
|
if(direction == 'prev'){
|
||||||
}
|
$('.field').css({
|
||||||
|
'margin-top': parseInt($('.field').css('margin-top')) - $('.current.ribbon').outerHeight()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
var res = $('<div class="ribbon"></div>')[insert]('.current.ribbon')
|
var res = $('<div class="ribbon"></div>')[insert]('.current.ribbon')
|
||||||
/*
|
/*
|
||||||
var res = $('<div class="new-ribbon"></div>')[insert]('.current.ribbon')
|
var res = $('<div class="new-ribbon"></div>')[insert]('.current.ribbon')
|
||||||
// HACK: without this, the class change below will not animate...
|
// HACK: without this, the class change below will not animate...
|
||||||
.show()
|
.show()
|
||||||
.addClass('ribbon')
|
.addClass('ribbon')
|
||||||
.removeClass('new-ribbon')
|
.removeClass('new-ribbon')
|
||||||
*/
|
*/
|
||||||
|
//})
|
||||||
|
|
||||||
|
$('.field').removeClass('unanimated')
|
||||||
|
|
||||||
|
//return $('.current.ribbon')['direction']('.ribbon')
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -548,8 +567,7 @@ function shiftImage(direction){
|
|||||||
|
|
||||||
}
|
}
|
||||||
// XXX this has to know about animations...
|
// XXX this has to know about animations...
|
||||||
//$('.current.image').click()
|
$('.current.image').click()
|
||||||
clickAfterTransitionsDone()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,20 @@
|
|||||||
|
.animated {
|
||||||
|
-webkit-transition: all 0.2s ease;
|
||||||
|
-moz-transition: all 0.2s ease;
|
||||||
|
-o-transition: all 0.2s ease;
|
||||||
|
-ms-transition: all 0.2s ease;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unanimated {
|
||||||
|
-webkit-transition: none;
|
||||||
|
-moz-transition: none;
|
||||||
|
-o-transition: none;
|
||||||
|
-ms-transition: none;
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.image {
|
.image {
|
||||||
float: left;
|
float: left;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user