slideshow

To loop through pages automatically we need a javascript timer on each page to trigger an iron python script that changes to the next page.




html
<FONT size=6><SPAN>the iron python script switches to the next page</SPAN></FONT> 

<DIV id=switchPageBtn><SpotfireControl id="ff8993c967e049f580fed8aa9b25ec45" /></DIV>


js
$(function(){
clearTimeout(document.body.timeout);
document.body.timeout=setTimeout(function(){$('#switchPageBtn input').click();}, 3000)
});

script 
#current page number
cp = Document.Pages.IndexOf(Document.ActivePageReference)

#total pages
tp = Document.Pages.Count

#calculate next page
np = cp+1 if cp+1<tp else 0

#go to next page
Document.ActivePageReference = Document.Pages[np]


1 comment:

Sandesh Prabhu said...

Hi Jose ,

This is very useful . Thanks for posting.