-2

I want to change a boolean attribute of an object in JavaScript (the object is from a library called fullPage.js). I want to change the navigation attribute to false, preferably from another file.

this is the object

Thanks in advance

mplungjan
  • 169,008
  • 28
  • 173
  • 236
  • Have you written the code by yourself, or is it hardcoded to the library? – Teemu Dec 12 '21 at 17:41
  • 1
    Please post some code to show what you have tried – spirift Dec 12 '21 at 17:41
  • 2
    [Why not upload images of code/errors when asking a question?](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question) – charlietfl Dec 12 '21 at 17:51
  • You cannot change the object unless you extract it from the code you show. So `const parms = { autoscrolling:true, navigation: false,....}; new fullpage('#fullpage',parms)` – mplungjan Dec 12 '21 at 17:55
  • Explain your use case in more detail and what higher level problem you are trying to solve. You may need to use the fullpage API – charlietfl Dec 12 '21 at 17:59

1 Answers1

-1

pretty straight forward. after you create the object just change the value for the key. If you want to do it from a file you have several ways of doing this.

  1. place the object first in local storage
  2. store the object on your backend
  3. place the object as a data element in your html

Show us what you've done so far

let fullpage = {autoscrolling:true,
                navagation:true}
            
console.log(fullpage)

fullpage.navagation = false

console.log(fullpage)
DCR
  • 14,737
  • 12
  • 52
  • 115