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.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.
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);
}