Nitu Dhaka
Nitu Dhaka

Reputation: 1330

Any way to find double current pages in turn.js?

My requirement is to display the current double pages in following format:-

and I only done with displaying singe page at a time however there is a double page view. like

Any idea how do I fetch these current double pages in expected format? I know I can do it by using adding logic, but would be better if I do it with internal logic of turnjs. because It can be happen only single page comes sometimes like cover page or last page. I am sure there must be a way to find by turnjs only. Any help will be appreciated... Thanks in Advance.

Upvotes: 1

Views: 1113

Answers (2)

Aljay
Aljay

Reputation: 456

To be more specific here you can use this property.

view

Eg.

var view = $("#flipbook").turn("view").join(" - ");
alert("Current view: "+view);

It will return like this.

0 - 1
2 - 3
.......

Read here: http://www.turnjs.com/docs/Property:_view

Upvotes: 1

Nitu Dhaka
Nitu Dhaka

Reputation: 1330

I found its solution.. There is an array with the name view that holds the page's numbers to display. If there is a page 1 it holds the value view[0] =1 View [1]=0 Similarly if its a last page lets say page 12 then the value in view will be View [0]=0 View [1]=12

And if we are at 4-5 pages then View [0]=4 View [1]=5

Got the solution :)

Upvotes: 1

Related Questions