Using iframes for reading books

This commit is contained in:
Las Zenow 2012-08-30 20:49:58 +02:00
parent c81992de2c
commit 45b2d47bd5
3 changed files with 65 additions and 26 deletions

View file

@ -32,9 +32,23 @@
{{end}}
</div>
<div class="span8">
{{.Txt}}
</div>
<script type="text/javascript">
function iframedoc(aID){
var framecont = null;
var frame=document.getElementById(aID);
if(frame.contentDocument)
framecont = frame.contentDocument;
else
framecont = document.frames[aID].document;
return framecont;
}
function iframe_resize(){
var myframe = document.getElementById('txt');
var frameDoc = iframedoc('txt');
myframe.height = frameDoc.body.offsetHeight+20;
}
</script>
<iframe class="span8" id="txt" onload="iframe_resize();" scrolling="no" src="{{.Content}}" seamless="seamless"></iframe>
</div>
<ul class="pager">