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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."