JS Automatic page turning

  • Last update:  2020-12-15
  • I. Overview

    1.1 Problem

    When we want to display the pagination report on the big screen, how to achieve the effect of automatically turning page?

    1.gif

     

    1.2 Solution

    Set the initial value of the flag parameter to 0, and use the delay function to perform different operations on the page after a specified time.

    When the flag value is 0, jump to the next page;

    When the current page is equal to the total number of report pages and the flag value is 0, the current report is refreshed;

    When the mouse clicks on the page, set the flag value to 1 and stop automatic page turning.

    II. Example

    After completing the pagination report, click Template> Template Web Attributes> Pagination Preview, select "individually set for this template", and add a "Loading End" event.

    2.png

    JavaScript:

    var flag=0;
    $(".content-container").click(
    function(){
    flag=1;
    })
    if(_g().currentPageIndex==_g().reportTotalPage){
    setTimeout(function(){
    if (flag==0) 
    {
    //Homepage  
              contentPane.gotoFirstPage(); 
    }},2000);
    }
    else{
    setTimeout(function()
    {
    if (flag==0)
    {
    contentPane.gotoNextPage();
    }},2000);
    }

    III. Download template

    Attachment List


    Theme: Report Application
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy