Using iframes for reading books
This commit is contained in:
parent
c81992de2c
commit
45b2d47bd5
3 changed files with 65 additions and 26 deletions
|
@ -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">
|
||||
|
|
Reference in a new issue