Created
August 20, 2016 17:25
-
-
Save fchasen/5eb32ae8c5c0ee5470765a6ef38ff034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
book.on('renderer:locationChanged', function(locationCfi){ | |
var epubcfi = new EPUBJS.EpubCFI(); | |
var doc = book.renderer.doc; | |
var mark = document.createElement("a"); | |
// Give the marker an unique id | |
mark.id = "look-for-me-1234"; | |
// Add the marker | |
epubcfi.addMarker(locationCfi, doc, marker); | |
// Counter words from start of document | |
// Break when you find the marker | |
// Remove the marker | |
epubcfi.removeMarker(mark, doc); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment