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

highlight not working post integrating with hammer.js for swiping #1378

Open
Panjady opened this issue Apr 22, 2024 · 1 comment
Open

highlight not working post integrating with hammer.js for swiping #1378

Panjady opened this issue Apr 22, 2024 · 1 comment

Comments

@Panjady
Copy link

Panjady commented Apr 22, 2024

<title>EPUB.js Pagination Example</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js"></script> <script src="epub.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js"></script> <style>
#viewer iframe {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
</style>
<script> function loadBook() { var book = ePub("BLS PM eBook (978-1-61669-799-0_1).epub"); var rendition = book.renderTo("viewer", { width: '100%' }); rendition.display(); rendition.on("selected", function (cfiRange, contents) { var selectedText = contents.window.getSelection().toString(); console.log(selectedText); rendition.annotations.highlight(cfiRange); });
  var manager = new Hammer.Manager(document.getElementById("viewer"), {});
  var Swipe = new Hammer.Swipe();
  manager.add(Swipe);

  manager.on('swipeleft', function(e){
    rendition.next();
  });

  manager.on('swiperight', function(e){
    rendition.prev();
  });
}
  
loadBook();
</script>
@Panjady
Copy link
Author

Panjady commented Apr 22, 2024

Here highlight does not work after integrating hammer.js for swiping , Can anyone suggest how to proceed furthur

@Panjady Panjady changed the title highlight now working post integrating with hammer.js for swiping highlight not working post integrating with hammer.js for swiping Apr 22, 2024
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

1 participant