mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +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...
|
||||
function zoomIn(){
|
||||
var zoom = $('.container').css('zoom')*2
|
||||
function zoom(factor){
|
||||
var zoom = $('.container').css('zoom')*factor
|
||||
var H = $('.meta-container').height()
|
||||
var W = $('.meta-container').width()
|
||||
|
||||
$('.container').animate({
|
||||
'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({
|
||||
$('.container').css({
|
||||
'zoom': zoom,
|
||||
'top': H/2 * 1/zoom - H/2,
|
||||
'left': W/2 * 1/zoom - W/2,
|
||||
@ -210,8 +199,8 @@ function zoomOut(){
|
||||
|
||||
</style>
|
||||
|
||||
<button onclick="zoomIn()">+</button>
|
||||
<button onclick="zoomOut()">-</button>
|
||||
<button onclick="zoom(1.1)">+</button>
|
||||
<button onclick="zoom(0.9)">-</button>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
@ -296,9 +285,5 @@ function zoomOut(){
|
||||
<div class="v-marker"></div>
|
||||
</div>
|
||||
|
||||
<!-- this is oddly aligned to the .squares -->
|
||||
<!--div class="toggle-animation-button">toggle animation</div-->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user