Search code examples
javascriptphpajaxturnjs

turnjs4 flipping page disables my scripts


I'm building a website that looks like a book using Turn.js. Each page is a .php file that utilizes javascript for page-turning effects.

Initially, all of my scripts work just fine. There are two pages in particular that are causing me problems though. A page with a list of books, that, when you click on them it displays a description, and an FAQ page that has clickable questions and displays the answers when clicked.

When I flip to page 9 and onward, and then flip back to the books page or FAQ page, the descriptions and answers javascript won't work anymore.

I've tried removing the javascript from one page and flipping pages still disables the other page's javascript so I know the javascript isn't a problem. So what else could disable my javascript?

Also a link to the site that I am building http://www.jalbertmann.com

UPDATE

So I have further established that this seems to be an AJAX related problem. Turn.js uses AJAX to fill the pages(divs) of the book like website with the content of other .php files. I have local scripts within these files and for some reason they only pass once. When I got to certain pages, the scripts, as I wrote above, fail. Is there anyone that can help me? I don't know enough about Turn.js's or AJAX's documentation.


Solution

  • turn.js automatically set pagesInDOM = 6 (line: 107) Change this to pagesInDOM = 1000 (line: 107)

    related file: turn.js