Team:Sevilla/template1
From 2011.igem.org
(Difference between revisions)
Line 11: | Line 11: | ||
<!--=====================================MENU ACORDEON ======================================= --> | <!--=====================================MENU ACORDEON ======================================= --> | ||
+ | <div id="sidebar"> | ||
+ | |||
<div id="firstpane" class="menu_list"> | <div id="firstpane" class="menu_list"> | ||
<p class="menu_head"> <a href="/Team:Sevilla">Home</a> </p> | <p class="menu_head"> <a href="/Team:Sevilla">Home</a> </p> | ||
Line 41: | Line 43: | ||
</div> | </div> | ||
+ | </div> | ||
+ | |||
<!-- http://roshanbh.com.np/2008/06/accordion-menu-using-jquery.html --> | <!-- http://roshanbh.com.np/2008/06/accordion-menu-using-jquery.html --> | ||
<style> | <style> | ||
Line 95: | Line 99: | ||
<!-- FIN --> | <!-- FIN --> | ||
+ | <!--- persecucion ---> | ||
+ | <script type="text/javascript"> | ||
+ | $(function() { | ||
+ | var offset = $("#sidebar").offset(); | ||
+ | var topPadding = 15; | ||
+ | $(window).scroll(function() { | ||
+ | if ($("#sidebar").height() < $(window).height() && $(window).scrollTop() > offset.top) { | ||
+ | $("#sidebar").stop().animate({ | ||
+ | marginTop: $(window).scrollTop() - offset.top + topPadding | ||
+ | }); | ||
+ | } else { | ||
+ | $("#sidebar").stop().animate({ | ||
+ | marginTop: 0 | ||
+ | }); | ||
+ | }; | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | </script> | ||
+ | <style> | ||
+ | #sidebar { width: 190px; float: left;padding:20px } | ||
+ | </style> | ||
+ | |||
+ | |||
<style> | <style> | ||
Revision as of 11:04, 15 June 2011