Answers.Body: <p>This <strong>is</strong> solvable thing but I wonder whether the animation and this effect are so much important for the book. The problem is these things are typical for relatively highly tuned web pages and implementing them into a book could bring more problems than it would solve.</p>
  
  <p>At the moment, eBook readers are often extremely memory-limited and it is suggested one chapter should have less than 300 KB!</p>
  
  <p>If you were still interested in the solution, check this <a href="http://forums.tumult.com/t/starting-an-animation-when-an-element-is-visible-with-jquery-waypoints/1138" rel="nofollow">post</a>.</p>
  
  <p>I have tried adding of jQuery into ebooks and it worked pretty well but it is still very experimental practice (just for fun at the moment!).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T07:34:35.573Z
Answers.LastActivityDate: 2015-09-04T07:34:35.573Z
Answers.UserDisplayName: Honza Hejzl
Answers.Body: <p>This seems to be a limitation for animation in reflowable format. As soon as we hit the first page of the html, the whole document will load and the animation will be performed before we hit that particular page.</p>
  
  <p>To stimulate this animation thru page turn script, we need to know the page number or the previous section id. But the fact, none of these parameters will work for us as the position of page will vary according to user settings.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-31T02:18:19.377Z
Answers.LastActivityDate: 2015-08-31T02:18:19.377Z
Answers.UserDisplayName: Arthic Leo
Body: <p>I have a large chunk of content that is too big to break into small individual chapters. The problem however, is that animations on page X have already run by the time I get there. Obviously body onload="foo()" won't solve my problem. I need to be able to call foo() once I am on the page containing the canvas. Is there a way to do this? Perhaps fire an event on page turn?</p>
  
Tags: <epub>
Title: Epub3 run js function on page turn event
UserDisplayName: user1658296
ThreadText: # Epub3 run js function on page turn event
  
  (Asked by: username_0 on 2015-08-06)
  
  I have a large chunk of content that is too big to break into small individual chapters. The problem however, is that animations on page X have already run by the time I get there. Obviously body onload="foo()" won't solve my problem. I need to be able to call foo() once I am on the page containing the canvas. Is there a way to do this? Perhaps fire an event on page turn?
  
  **Tags:** epub
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-09-04. Score: 1
  
  This **is** solvable thing but I wonder whether the animation and this effect are so much important for the book. The problem is these things are typical for relatively highly tuned web pages and implementing them into a book could bring more problems than it would solve.
  
  At the moment, eBook readers are often extremely memory-limited and it is suggested one chapter should have less than 300 KB!
  
  If you were still interested in the solution, check this [post](http://forums.tumult.com/t/starting-an-animation-when-an-element-is-visible-with-jquery-waypoints/1138).
  
  I have tried adding of jQuery into ebooks and it worked pretty well but it is still very experimental practice (just for fun at the moment!).
  
  
  ---
  
  ### Answer by username_2 on 2015-08-31. Score: 0
  
  This seems to be a limitation for animation in reflowable format. As soon as we hit the first page of the html, the whole document will load and the animation will be performed before we hit that particular page.
  
  To stimulate this animation thru page turn script, we need to know the page number or the previous section id. But the fact, none of these parameters will work for us as the position of page will vary according to user settings.
  
  
  ---
  
  