mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
remove any uses of offsetLeft, cleaned up storage
This commit is contained in:
parent
7f41f00775
commit
5d7a15eabd
14 changed files with 102 additions and 72 deletions
|
@ -303,11 +303,9 @@ FP.Chapter.prototype.section = function(fragment){
|
|||
var el = this.doc.getElementById(fragment),
|
||||
left, pg;
|
||||
|
||||
|
||||
if(el){
|
||||
left = this.leftPos + el.offsetLeft, //-- Calculate left offset compaired to scrolled position
|
||||
left = this.leftPos + el.getBoundingClientRect().left, //-- Calculate left offset compaired to scrolled position
|
||||
pg = Math.floor(left / this.spreadWidth) + 1; //-- pages start at 1
|
||||
|
||||
this.page(pg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue