Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

103
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda