.scrollTo() without animation

3 posts, 1 answers
  1. Vladimir
    Vladimir avatar
    4 posts
    Member since:
    Jan 2013

    Posted 15 Jan 2013 Link to this post

    Hello

    Is any way to temporary disable animation for .scrollTo(page) method?
    I tried something like this:
    that._ScrollView.duration = 1;
    that._ScrollView.scrollTo(activePage);
    that._ScrollView.duration = 300;
    but with no success... 

    I am trying to implement infinite scroll view (for swiping between news articles). 
    My Scroll view has 3 pages.  So, when user swipes from 2 -> 3 the content moves from 2 to 1, from 3 to 2, and the new article loads into the third page, and ScrollView scrolls to the second page again (without animation). 
  2. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 17 Jan 2013 Link to this post

    Hello Vladimir,

    The scrollTo method does not provide an option for disabling the animation, however this could be achieved by using internal methods. Here is the code:
    var scrollView = $("#scrollview").data("kendoMobileScrollView");
    scrollView.transition.moveTo({
        location: -4 * scrollView.dimension.getSize(),
        duration: 1,
        ease: kendo.fx.Transition.easeOutExpo
    });
     
    //where 4 is the page number

    Please note that the page number should have a minus infront.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Vladimir
    Vladimir avatar
    4 posts
    Member since:
    Jan 2013

    Posted 20 Jan 2013 Link to this post

    Alexander, thank you
Back to Top