tweaking (starting to feel like it's too much effort to be worth it)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-05-20 03:16:07 +03:00
parent 8f4480a12e
commit 670fcccf73

View File

@ -221,7 +221,7 @@ var setup = function(){
var ISCROLL = true var ISCROLL = false
$(function(){ $(function(){
@ -250,7 +250,9 @@ if(ISCROLL){
var t var t
$('.scaler').on('touchend mouseup', function(){ $('.scaler').on('touchend mouseup', function(){
t = $('.ribbon-set')[0].style.transform //t = $('.ribbon-set')[0].style.transform
t = $('.ribbon-set').offset().left
}) })
scroll_view.on('zoomEnd', function(){ scroll_view.on('zoomEnd', function(){
var v = $('.viewer') var v = $('.viewer')
@ -259,17 +261,26 @@ if(ISCROLL){
var W = v.width() var W = v.width()
var H = v.width() var H = v.width()
var e = $('.ribbon-set')[0] var w = W/s
var h = H/s
var e = $('.ribbon-set')
// XXX compensate for offset -- scroll ribbons by to // XXX compensate for offset -- scroll ribbons by to
// place them where they where under user's fingers... // place them where they where under user's fingers...
console.log('>>>>', t) // XXX this does not work...
scroll_ribbon.forEach(function(r){ /*
// XXX ~(W/s - translateX) var d = (e.offset().left - t) * s
$('.ribbon').each(function(_, r){
$(r).velocity({
transformX: '+='+d,
}, 0)
}) })
*/
e.style.width = (W / s) + 'px' e = e[0]
e.style.height = (H / s) + 'px' e.style.width = w + 'px'
e.style.height = h + 'px'
}) })
@ -283,6 +294,8 @@ if(ISCROLL){
// - two fingers will trigger zoom // - two fingers will trigger zoom
// - for some reason if touching two ribbons while // - for some reason if touching two ribbons while
// zooming they will move in the same direction... // zooming they will move in the same direction...
// - scrolling a ribbon does not account for scale...
// ...the same problem exists for native scroll...
window.scroll_ribbon = [] window.scroll_ribbon = []
$('.ribbon-container')//.eq(0) $('.ribbon-container')//.eq(0)
.css({ .css({