Team:OUC-China/Project Future
From 2014.igem.org
(Difference between revisions)
Line 192: | Line 192: | ||
<div id="mainContent" style="width:1024px;background-color:#d2e9fd;padding:10px;margin:0 auto"> | <div id="mainContent" style="width:1024px;background-color:#d2e9fd;padding:10px;margin:0 auto"> | ||
<!--在这里放置文章内容--> | <!--在这里放置文章内容--> | ||
+ | </div> | ||
+ | <div id="childNavigator" style="width:180px"> | ||
+ | <ul class="nav"> | ||
+ | <li class=""><a href="#Self_Lysis_Device_Automatically">Self-lysis device automatically</a></li> | ||
+ | </ul> | ||
</div> | </div> | ||
<script> | <script> | ||
+ | function resizeElement() { | ||
+ | var content = $('#mainContent'); | ||
+ | var navi = $('#childNavigator'); | ||
+ | if (window.innerWidth < 1384) | ||
+ | { | ||
+ | content.css({ margin: '0 auto 0 180px' }); | ||
+ | navi.css({width:'180px'}); | ||
+ | } else { | ||
+ | content.css({ margin: '0 auto' }); | ||
+ | navi.css({ width: (window.innerWidth - 1024) / 2 - 8 + 'px' }); | ||
+ | } | ||
+ | } | ||
+ | window.onresize = resizeElement; | ||
+ | resizeElement(); | ||
$(document.body).scrollspy({ target: '#childNavigator' }); | $(document.body).scrollspy({ target: '#childNavigator' }); | ||
$('#childNavigator').affix({ offset: { top: 285 } }); | $('#childNavigator').affix({ offset: { top: 285 } }); |
Revision as of 18:15, 17 October 2014