View Single Post
Old 04-27-2015, 06:55 AM   #6
ribik
Junior Member
ribik began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2014
Device: none
File: ebooks.oeb.display.paged.js

PagedDisplay.prototype.column_at = function(xpos) {
var section_page, new_xpos;
section_page = Math.floor(xpos / this.page_width);
if (section_page % 2 === 1) {
section_page -=1;
new_xpos = section_page * this.page_width;
section_page = this.scroll_to_xpos(new_xpos);
}
return Math.floor(xpos / this.page_width);
};

This is how I wanted it to work. I know it is a "dirty hack", but it works perfectly for my needs, because I have two pages per screen. Backward scroll now works as it should. I'm sure it can be done better, to work with multi-columns (section_page % this.cols_per_screen), but for my reading it's ok.
ribik is offline   Reply With Quote