Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating bookmarks #244

Open
CoreyEWalsh opened this issue Apr 18, 2014 · 1 comment
Open

Creating bookmarks #244

CoreyEWalsh opened this issue Apr 18, 2014 · 1 comment

Comments

@CoreyEWalsh
Copy link

I'm trying to replicate booki.sh's use of bookmarks in their book.

Does anybody have any insight on how I can do this?

@AbhilashThomas
Copy link

Don't know about booki.sh, but you could use something like

var locus = {
      componentId: reader.getPlace().componentId(),
      percent: reader.getPlace().percentageThrough()
    }


/// or better

var locus = reader.getPlace().getLocus();

You can then use the 'locus' to move to that location in the book.

reader.moveTo(locus);

//which will go as

reader.moveTo({componentId:"components/3.html",percent:0.8});

If you want to persist the book mark, see the placesaver control to understand how to store in cookie or localStorage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants