The iframe should be as big as the book menu, so the covers are well align
This commit is contained in:
parent
3d69ce8e03
commit
75bb911aaa
1 changed files with 8 additions and 2 deletions
|
@ -23,7 +23,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{range .In}}
|
{{range .In}}
|
||||||
<ul class="nav nav-list hidden-phone">
|
<ul id="bookMenu" class="nav nav-list hidden-phone">
|
||||||
{{end}}
|
{{end}}
|
||||||
<li {{if .Active}}class="active"{{end}}><a href="{{.Link}}">{{.Label}}</a></li>
|
<li {{if .Active}}class="active"{{end}}><a href="{{.Link}}">{{.Label}}</a></li>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -35,7 +35,13 @@
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function resizeIframe() {
|
function resizeIframe() {
|
||||||
$("#bookContent").height($("#bookContent").contents().find("html").height());
|
var contentHeight = $("#bookContent").contents().find("html").height();
|
||||||
|
var menuHeight = $("#bookMenu").height();
|
||||||
|
if (contentHeight < menuHeight) {
|
||||||
|
$("#bookContent").height(menuHeight);
|
||||||
|
} else {
|
||||||
|
$("#bookContent").height(contentHeight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<iframe id="bookContent" onload="resizeIframe();" style="width: 100%; border: none;" scrolling="no" src="{{.Content}}" seamless="seamless"></iframe>
|
<iframe id="bookContent" onload="resizeIframe();" style="width: 100%; border: none;" scrolling="no" src="{{.Content}}" seamless="seamless"></iframe>
|
||||||
|
|
Reference in a new issue