Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
Toggle single page and multiple page in pdfviewer plugin

I am messing around real3d-flipbook to include a new button where the user can decide whether he wants to view the pdf as 2 pages like a book or single page.

I have managed to do the code but when I change the singlePageMode on click of the button, a particular method is being called multiple times resulting in Uncaught RangeError: Maximum call stack size exceeded This is where I am changing the singlePageMode from flipbook.min.js

togglePage:function(){
        var e=this.options;
        e.singlePageMode=!e.singlePageMode;
        this.toggleIcon(this.btnPage,e.singlePageMode)                                                      
},

and this is the function in flipbook.book3.min.js that is being called multiple times when I change the singlePageMode:

FLIPBOOK.Book3.prototype.updateBookPosition=function(){ 
    if(this.options.singlePageMode)
        return this.setWrapperW(this.pageWidth),this.$wrapper.width(this.pageWidth),this.scroll&&this.scroll.refresh(),this.view=1,void this.focusRight();1==this.view?this.setWrapperW(this.pageWidth):this.setWrapperW(2*this.pageWidth),this.scroll&&this.scroll.refresh(),2==this.view?this.isCover()?this.focusRight():this.isBackCover()&&this.options.cover?this.focusLeft():this.focusBoth():1==this.view&&(this.isCover()?this.focusRight():this.isBackCover()&&this.focusLeft())},

I have tried to recreate the book like this which results in another book under the previous one with no idea how to remove the first one:

togglePage:function(){
    var e=this.options;
    e.singlePageMode=!e.singlePageMode;
    this.loadScript(FLIPBOOK.flipbookBook3Src,this.createBook),
    console.log(this);
    this.toggleIcon(this.btnPage,e.singlePageMode)                                                      
},

This eliminates the problem with calling updateBookPosition multiple times but is showing 2 books - the original above the new one. Any idea how I eliminate the previous one or update it without hitches?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!