tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-05-19 23:52:29 +03:00
parent c2d3126ade
commit 8f4480a12e

View File

@ -228,8 +228,9 @@ $(function(){
setup() setup()
// setup iScroll...
if(ISCROLL){ if(ISCROLL){
// setup iScroll... // Vertical scroll and zoom...
$('.scaler') $('.scaler')
.css({ .css({
overflow: 'hidden', overflow: 'hidden',
@ -247,21 +248,41 @@ if(ISCROLL){
zoom: true, zoom: true,
}) })
scroll_view var t
.on('zoomEnd', function(){ $('.scaler').on('touchend mouseup', function(){
var v = $('.viewer') t = $('.ribbon-set')[0].style.transform
})
scroll_view.on('zoomEnd', function(){
var v = $('.viewer')
var s = scroll_view.scale var s = scroll_view.scale
var W = v.width() var W = v.width()
var H = v.width() var H = v.width()
var e = $('.ribbon-set')[0] var e = $('.ribbon-set')[0]
// XXX not yet correct... // XXX compensate for offset -- scroll ribbons by to
e.style.width = (W / s) + 'px' // place them where they where under user's fingers...
e.style.height = (H / s) + 'px' console.log('>>>>', t)
scroll_ribbon.forEach(function(r){
// XXX ~(W/s - translateX)
}) })
e.style.width = (W / s) + 'px'
e.style.height = (H / s) + 'px'
})
// Ribbon scroll...
//
// Problems:
// - iScroll does not account for margins when aclculating
// scroll width, need to patch this on .update(..)...
// - can't scroll ribbons independently
// - two fingers will trigger zoom
// - for some reason if touching two ribbons while
// zooming they will move in the same direction...
window.scroll_ribbon = [] window.scroll_ribbon = []
$('.ribbon-container')//.eq(0) $('.ribbon-container')//.eq(0)
.css({ .css({