Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

100
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda