mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 19:00:09 +00:00
minor fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
05a916d834
commit
b65d82bc7d
@ -106,23 +106,12 @@ function alignRibbon(square, position, zoom){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// XXX need to fix animation jumping around...
|
// XXX need to fix animation jumping around...
|
||||||
function zoomIn(){
|
function zoom(factor){
|
||||||
var zoom = $('.container').css('zoom')*2
|
var zoom = $('.container').css('zoom')*factor
|
||||||
var H = $('.meta-container').height()
|
var H = $('.meta-container').height()
|
||||||
var W = $('.meta-container').width()
|
var W = $('.meta-container').width()
|
||||||
|
|
||||||
$('.container').animate({
|
$('.container').css({
|
||||||
'zoom': zoom,
|
|
||||||
'top': H/2 * 1/zoom - H/2,
|
|
||||||
'left': W/2 * 1/zoom - W/2,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
function zoomOut(){
|
|
||||||
var zoom = $('.container').css('zoom')*0.5
|
|
||||||
var H = $('.meta-container').height()
|
|
||||||
var W = $('.meta-container').width()
|
|
||||||
|
|
||||||
$('.container').animate({
|
|
||||||
'zoom': zoom,
|
'zoom': zoom,
|
||||||
'top': H/2 * 1/zoom - H/2,
|
'top': H/2 * 1/zoom - H/2,
|
||||||
'left': W/2 * 1/zoom - W/2,
|
'left': W/2 * 1/zoom - W/2,
|
||||||
@ -210,8 +199,8 @@ function zoomOut(){
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<button onclick="zoomIn()">+</button>
|
<button onclick="zoom(1.1)">+</button>
|
||||||
<button onclick="zoomOut()">-</button>
|
<button onclick="zoom(0.9)">-</button>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
@ -296,9 +285,5 @@ function zoomOut(){
|
|||||||
<div class="v-marker"></div>
|
<div class="v-marker"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- this is oddly aligned to the .squares -->
|
|
||||||
<!--div class="toggle-animation-button">toggle animation</div-->
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user