Difference between revisions of "Team:Aalto-Helsinki/Modeling synergy"
m (z-index not defined here) |
(modified the site navigation to be responsive) |
||
Line 37: | Line 37: | ||
padding-bottom: 1px; | padding-bottom: 1px; | ||
} | } | ||
− | + | #sidenav a:hover, | |
+ | #sidenav a.active { | ||
+ | color: black !important; | ||
} | } | ||
</style> | </style> | ||
<ul id="sidenav" class="nav nav-stacked"><!-- nav-pills if we want rounded corners --> | <ul id="sidenav" class="nav nav-stacked"><!-- nav-pills if we want rounded corners --> | ||
− | <li><a href="#introduction"><h3>Introduction</h3></a></li> | + | <li><a href="#" data-scroll="introduction"><h3>Introduction</h3></a></li> |
− | <li><a href="#assumptions"><h3>Assumptions</h3></a></li> | + | <li><a href="#" data-scroll="assumptions"><h3>Assumptions</h3></a></li> |
− | <li><a href="#results"><h3>Results</h3></a></li> | + | <li><a href="#" data-scroll="results"><h3>Results</h3></a></li> |
− | <li><a href="#discussion"><h3>Discussion</h3></a></li> | + | <li><a href="#" data-scroll="discussion"><h3>Discussion</h3></a></li> |
− | + | <li><a href="#"><h3 style="border-top:solid;">To the Top</h3></a></li> | |
− | + | </ul> | |
Line 54: | Line 56: | ||
<h1>Synergy/Particle model</h1> | <h1>Synergy/Particle model</h1> | ||
− | < | + | <!-- Introduction --> |
+ | <section id="introduction" class="active" data-anchor="introduction"> | ||
+ | |||
+ | <h2>Introduction</h2> | ||
<p>Introduction text</p> | <p>Introduction text</p> | ||
− | < | + | </section> |
+ | <!-- Introduction end --> | ||
+ | |||
+ | |||
+ | <!-- Assumptions and background --> | ||
+ | <section id="assumptions" data-anchor="assumptions"> | ||
+ | |||
+ | <h2>Assumptions and other background</h2> | ||
<p>What we have assumed and why and how they affect.</p> | <p>What we have assumed and why and how they affect.</p> | ||
+ | |||
+ | </section> | ||
+ | <!-- Assumptions end --> | ||
+ | |||
+ | |||
+ | <!-- Awesome results! --> | ||
+ | <section id="results" data-anchor="results"> | ||
<h2 id="results">Results</h2> | <h2 id="results">Results</h2> | ||
<p>Our awesome results!</p> | <p>Our awesome results!</p> | ||
+ | |||
+ | </section> | ||
+ | <!-- Results end --> | ||
+ | |||
+ | |||
+ | <!-- Discussion --> | ||
+ | <section id="discussion" data-anchor="discussion"> | ||
<h2 id="discussion">Implications of the model</h2> | <h2 id="discussion">Implications of the model</h2> | ||
<p>Here talk about what the results actually say, containing restrictions</p> | <p>Here talk about what the results actually say, containing restrictions</p> | ||
+ | |||
+ | |||
+ | </section> | ||
+ | <!-- Discussion ends --> | ||
+ | |||
</div> | </div> | ||
</div></div></div> <!--These are the closing tags for div id="mainContainer" and div id="contentContainer". The corresponding opening tags appear in the template that is {{included}} at the top of this page.--> | </div></div></div> <!--These are the closing tags for div id="mainContainer" and div id="contentContainer". The corresponding opening tags appear in the template that is {{included}} at the top of this page.--> | ||
+ | |||
+ | |||
+ | |||
+ | <!-- here scripts to make the site navigation beautiful and responsive. --> | ||
+ | <script> | ||
+ | |||
+ | $('#sidenav a').on('click', function() { | ||
+ | |||
+ | var scrollAnchor = $(this).attr('data-scroll'), | ||
+ | scrollPoint = $('section[data-anchor="' + scrollAnchor + '"]').offset().top - 28; | ||
+ | |||
+ | $('body,html').animate({ | ||
+ | scrollTop: scrollPoint | ||
+ | }, 500); | ||
+ | |||
+ | return false; | ||
+ | |||
+ | }) | ||
+ | |||
+ | |||
+ | $(window).scroll(function() { | ||
+ | var windscroll = $(window).scrollTop(); | ||
+ | if (windscroll >= 100) { | ||
+ | $('.inner-container section').each(function(i) { | ||
+ | if ($(this).position().top <= windscroll + 20) { | ||
+ | $('#sidenav a.active').removeClass('active'); | ||
+ | $('#sidenav a').eq(i).addClass('active'); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | } else { | ||
+ | |||
+ | $('#sidenav a.active').removeClass('active'); | ||
+ | $('#sidenav a:first').addClass('active'); | ||
+ | } | ||
+ | |||
+ | }).scroll(); | ||
+ | |||
+ | </script> | ||
+ | |||
+ | |||
</body> | </body> | ||
</html> | </html> |
Revision as of 07:10, 19 August 2015