Team:USTC-Software/text
From 2012.igem.org
(Difference between revisions)
Line 321: | Line 321: | ||
<body> | <body> | ||
+ | |||
+ | |||
+ | <div id="global_header"> | ||
+ | <div id="team_logo"></div> | ||
+ | |||
+ | <div id="navs"> | ||
+ | <ul> | ||
+ | <li><a href="#"/><div id="home_botton"></div></li> | ||
+ | |||
+ | <a href="#"/><div id="project_botton"></div> | ||
+ | |||
+ | <a href="#"/><div id="team_botton"></div> | ||
+ | |||
+ | <a href="#"/><div id="notes_botton"></div> | ||
+ | |||
+ | <a href="#"/><div id="hp_botton"></div> | ||
+ | </ul> | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <!-- the begin of search box controls --> | ||
+ | <div id="search-control-box"> | ||
+ | <form action="https://2012.igem.org/Special:Search" id="searchform"> | ||
+ | <input id="searchInput" name="search" type="text" title="Search 2012.igem.org [alt-f]" accesskey="f" value="" autocomplete="off"x-webkit-speech x-webkit-grammar="bUIltin:search" placeholder="Search for fun" onFocus="if (this.placeholder == 'Search for fun') {this.placeholder = '';}" onBlur="if (this.placeholder == '') {this.placeholder = 'Search for fun';}" /> <input type="submit" name="go" class="search_button" id="searchGoButton" value="Go" title="Go to a page with this exact name if exists" x-webkit-speech=""> | ||
+ | <input type="submit" name="fulltext" class="search_button" id="mw-search_button" value="Search" title="Search the pages for this text" x-webkit-speech=""> | ||
+ | </form> | ||
+ | </div> <!-- the end of search box controls --> | ||
+ | |||
+ | </div> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <!-----the begin of go to top div ---> | ||
+ | <div class="clr"></div> | ||
+ | <div id="topBar"> | ||
+ | <div id="goToTop" class="goToTop">TOP</div> | ||
+ | </div><!-----the begin of go to top div----> | ||
+ | |||
+ | <script type="text/javascript"> | ||
+ | (function(){ | ||
+ | var special = jQuery.event.special, | ||
+ | uid1 = 'D' + (+new Date()), | ||
+ | uid2 = 'D' + (+new Date() + 1); | ||
+ | |||
+ | special.scrollstart = { | ||
+ | setup: function(){ | ||
+ | var timer, | ||
+ | handler = function(evt) { | ||
+ | var _self = this, | ||
+ | _args = arguments; | ||
+ | |||
+ | if(timer) { | ||
+ | clearTimeout(timer); | ||
+ | } else { | ||
+ | evt.type = 'scrollstart'; | ||
+ | jQuery.event.handle.apply(_self,_args); | ||
+ | } | ||
+ | |||
+ | timer = setTimeout(function(){ | ||
+ | timer = null; | ||
+ | },special.scrollstop.latency); | ||
+ | }; | ||
+ | jQuery(this).bind('scroll',handler).data(uid1,handler); | ||
+ | }, | ||
+ | teardown: function(){ | ||
+ | jQuery(this).unbind('scroll',jQuery(this).data(uid1)); | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | special.scrollstop = { | ||
+ | latency: 300, | ||
+ | setup: function(){ | ||
+ | var timer, | ||
+ | handler = function(evt) { | ||
+ | var _self = this, | ||
+ | _args = arguments; | ||
+ | |||
+ | if(timer) { | ||
+ | clearTimeout(timer); | ||
+ | } | ||
+ | |||
+ | timer = setTimeout(function(){ | ||
+ | timer = null; | ||
+ | evt.type = 'scrollstop'; | ||
+ | jQuery.event.handle.apply(_self,_args); | ||
+ | },special.scrollstop.latency); | ||
+ | }; | ||
+ | jQuery(this).bind('scroll',handler).data(uid2,handler); | ||
+ | }, | ||
+ | teardown: function() { | ||
+ | jQuery(this).unbind('scroll',jQuery(this).data(uid2)); | ||
+ | } | ||
+ | }; | ||
+ | })(); | ||
+ | </script> | ||
+ | <script type="text/javascript"> | ||
+ | $(function(){ | ||
+ | //the element inside of which we want to scroll | ||
+ | var btns = $("#topBar div"); | ||
+ | //show the buttons | ||
+ | btns.fadeIn("slow"); | ||
+ | //whenever we scroll fade out both buttons | ||
+ | $(window).bind("scrollstart",function(){ | ||
+ | btns.stop().animate({"opacity":"0.2"}); | ||
+ | }); | ||
+ | //...and whenever we stop scrolling fade in both buttons | ||
+ | $(window).bind("scrollstop",function(){ | ||
+ | btns.stop().animate({"opacity":"1"}); | ||
+ | }); | ||
+ | //clicking the "goToTop" button will make the page scroll to the top of the page | ||
+ | $("#goToTop").click(function(e){ | ||
+ | $("html,body").animate({scrollTop:"0px"},800); | ||
+ | }); | ||
+ | }); | ||
+ | </script><!-----the rnd of go to top js----> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
<!---the begin of slider div------> | <!---the begin of slider div------> |
Revision as of 03:14, 15 August 2012
TOP