1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    7
    Vote Rating
    0
    glom1029 is on a distinguished road

      0  

    Default Unanswered: What does the animation in scrollTo(x, y, true) do?

    Unanswered: What does the animation in scrollTo(x, y, true) do?


    When I use
    Code:
    scrollTo(x, y)
    , everything looks fine without animation.

    But when I use
    Code:
    scrollTo(x, y, true)
    or
    Code:
    scrollTo(x, y, {duration: 250, easing: { type: 'ease-out' }})
    , the container "reset" after it scrolls to the right place.

    How can I prevent that?

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    7
    Vote Rating
    0
    glom1029 is on a distinguished road

      0  

    Default


    I solved this problem by
    adding one more
    Code:
    scrollTo(x, y)
    in onAnimationEnd event,
    though I still don't know why I have to add this.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    7
    Vote Rating
    0
    glom1029 is on a distinguished road

      0  

    Default


    I found out that in sencha-touch-all.js there's an event
    Code:
    onAnimationEnd: function() {
            this.snapToBoundary();
            this.onScrollEnd();
        }
    that works after every animation. And snapToBoundary() function is something like this
    Code:
    snapToBoundary: function() {
            var position = this.position,
                minPosition = this.getMinPosition(),
                maxPosition = this.getMaxPosition(),
                minX = minPosition.x,
                minY = minPosition.y,
                maxX = maxPosition.x,
                maxY = maxPosition.y,
                x = Math.round(position.x),
                y = Math.round(position.y);
    
    
            if (x < minX) {
                x = minX;
            }
            else if (x > maxX) {
                x = maxX;
            }
    
    
            if (y < minY) {
                y = minY;
            }
            else if (y > maxY) {
                y = maxY;
            }
    
    
            this.scrollTo(x, y);
        }
    My (x, y) is always (0, 0) just before
    Code:
    this.scrollTo(x, y);
    , so it gets back to the origin every scroll.

    I think this function's for preventing the content from going out of the container.

    Isn't it weird?
    Isn't scrolling for something that can't be contained in the container?

  4. #4
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    227
    Answers
    64
    Vote Rating
    20
    haduki will become famous soon enough haduki will become famous soon enough

      0  

    Default


    it means your content have not got enough width or height to scroll.
    Can you post your container layout config and its items?
    I write English by translator.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar