View Single Post
Old 09-20-2015, 04:43 PM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Out of curiosity, I've looked into this. You could theoretically get the top offset of an element with offsetTop and the available height of the window with window.screen.availHeight and hide the object if the vertical offset is larger than 50% of the available window height.
This method kind of works with a browser and to some extent with ADE4, but I got weird results with other ePub3 apps.
I.e., this method is probably not robust enough for practical use.
I've attached a very simple proof-of-concept test file that you can play with.
(Uncomment //myDiv.parentNode.removeChild(myDiv); to actually delete the div.)
Attached Files
File Type: epub JavaScriptTest.epub (62.1 KB, 397 views)

Last edited by Doitsu; 09-20-2015 at 04:47 PM.
Doitsu is offline   Reply With Quote