[ 5 posts ]

Ray Tsun-Jui Wen

YUI Contributor

  • Username: Ray Wen
  • Joined: Wed Feb 22, 2012 10:24 pm
  • Posts: 6
  • GitHub: raytjwen
  • Gists: raytjwen
  • IRC: Ray
  • Offline
  • Profile

Problem of Scroll View with Paginator when scrolling to next

Post Posted: Tue May 15, 2012 2:46 am
+0-
I face a problem that when I trying to make two button to control the pages of scroll view.
Like this.
Image
When the button is clicked, scroll view should scroll to page 2.
It works just fine under IE&FF like this.
Image

When using chrome, not frequently, but sometimes it scroll too much.
Like this.
Image
I think padding cause this. Somehow it calculates the wrong value to scroll when the first move.

http://raytjwen.droppages.com/yui3_scv_test.html
This demo page is simplified version of what I need.

Is that anything I can try to resolve this problem?
Thanks for any suggestion.

Derek Gathright

YUI Developer

  • Username: drgath
  • Joined: Thu Apr 22, 2010 10:18 am
  • Posts: 7
  • Location: San Francisco, CA
  • Twitter: derek
  • GitHub: derek
  • Gists: derek
  • IRC: dgathright
  • YUI Developer
  • Offline
  • Profile

Re: Problem of Scroll View with Paginator when scrolling to

Post Posted: Wed May 16, 2012 10:56 am
+0-
Hmm... I'm unable to reproduce on Chrome (v19). Anyone else able to replicate the issue?

Ray Tsun-Jui Wen

YUI Contributor

  • Username: Ray Wen
  • Joined: Wed Feb 22, 2012 10:24 pm
  • Posts: 6
  • GitHub: raytjwen
  • Gists: raytjwen
  • IRC: Ray
  • Offline
  • Profile

Re: Problem of Scroll View with Paginator when scrolling to

Post Posted: Fri May 18, 2012 1:35 am
+0-
I can understand. It's really hard to reproduce.
After some experiment, I found that no matter "parent's padding" or "self margin" will cause this strange situation (by chance).

So I try different styling way. Using "children's margin" to make the same looks.
And it works just fine, so far.

But I have another question is how to slow down the animation speed when page changing?
I have try
Code:
Y.one('.lf-btn').on('click', function(E) {mySCV.pages.scrollTo(0, 1000, 'linear');});
Y.one('.rt-btn').on('click', function(E) {mySCV.pages.scrollTo(1, 5000, 'linear');});

It doesn't work and the animation seems the same.
This is the demo page: http://raytjwen.droppages.com/yui3_scv_test.html
Thanks for any response.

Juan Ignacio Dopazo

YUI Contributor

  • Username: jdopazo
  • Joined: Fri Oct 02, 2009 5:39 am
  • Posts: 638
  • Location: Buenos Aires, Argentina
  • Twitter: juandopazo
  • GitHub: juandopazo
  • Gists: juandopazo
  • Offline
  • Profile

Re: Problem of Scroll View with Paginator when scrolling to

Post Posted: Fri May 18, 2012 6:06 am
+0-
That last one is a bug. I looked into it and there's a badly written ternary operator in ScrollView. You can use this patch to make it work:
Code:
Y.ScrollView.prototype._uiScrollTo = function (x, y, duration, easing) {
  duration = duration || (this._snapToEdge ? 400 : 0);
  easing = easing || (this._snapToEdge ? ScrollView.SNAP_EASING : null);
  this.scrollTo(x, y, duration, easing);
};

Ray Tsun-Jui Wen

YUI Contributor

  • Username: Ray Wen
  • Joined: Wed Feb 22, 2012 10:24 pm
  • Posts: 6
  • GitHub: raytjwen
  • Gists: raytjwen
  • IRC: Ray
  • Offline
  • Profile

Re: Problem of Scroll View with Paginator when scrolling to

Post Posted: Sun May 20, 2012 10:29 pm
+0-
Thank you, Juan.
I'll try this.

Best regards,
Ray
  [ 5 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum