1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00

added queue to render events and displays

This commit is contained in:
Fred Chasen 2013-08-26 21:46:59 -07:00
parent 2d19ae683c
commit 5af9e6cd4c
11 changed files with 246 additions and 76 deletions

View file

@ -172,20 +172,21 @@ EPUBJS.Hooks.register("beforeChapterDisplay").smartimages = function(callback, c
height = oHeight || rectHeight,
newHeight;
iheight = chapter.bodyEl.clientHeight;
iheight = chapter.docEl.clientHeight;
if(top < 0) top = 0;
if(height + top >= iheight) {
if(top < iheight/2) {
newHeight = iheight - top;
item.style.maxHeight = newHeight + "px";
item.style.width= "auto";
}else{
height = (height < iheight ? height : iheight);
newHeight = (height < iheight ? height : iheight);
item.style.maxHeight = newHeight + "px";
item.style.marginTop = iheight - top + "px";
item.style.width= "auto";
console.log(newHeight)
}
item.setAttribute('data-height', newHeight);