joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

How to jump or move to the specified chapter or next page #153

Open tkminh opened 11 years ago

tkminh commented 11 years ago

Hello all,

I'm making a app reader. But I want to use my own control for move next or prev page & chapter. I try to implement but not successful

reader.moveTo( { direction : 1 }); or reader.moveTo({ componentId: "Test1.htm"});

Please help me.

joseph commented 11 years ago

Those look like they'd work to me. Are you getting an error?

priti123 commented 11 years ago

I am using my own control to move to next or previous page the code is as below but its not working

function moveNextPage(rdr) {

                var next = {}
                next.createControlElements = function (rdr) {
                    var btn = document.createElement('div');
                    btn.className = "next";

                     Monocle.Events.listen(btn, typeof Touch == "object" ? "touchstart" : "mousedown",
      function (evt) {
          rdr.moveTo( {
              direction : 1
          });

                    rdr.addControl(next);
                    return next;
                }
            }

Please Help.

pateljatin commented 9 years ago

@tkminh - were you able to make reader.moveTo work? It's not working for me either...