Template:Team:NCTU Formosa/header-safety
From 2012.igem.org
(Difference between revisions)
Line 6: | Line 6: | ||
.safety-s-wrapper { | .safety-s-wrapper { | ||
- | width: | + | width:900px; |
background:url(https://static.igem.org/mediawiki/2012/8/84/Px.png) transparent repeat; | background:url(https://static.igem.org/mediawiki/2012/8/84/Px.png) transparent repeat; | ||
-moz-box-shadow:4px 4px 8px 2px rgba(20%,20%,40%,0.5); | -moz-box-shadow:4px 4px 8px 2px rgba(20%,20%,40%,0.5); | ||
Line 141: | Line 141: | ||
<script> | <script> | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
- | |||
// hide #back-top first | // hide #back-top first | ||
$("#back-top").hide(); | $("#back-top").hide(); | ||
- | |||
// fade in #back-top | // fade in #back-top | ||
- | |||
- | |||
$(function () { | $(function () { | ||
$(window).scroll(function () { | $(window).scroll(function () { | ||
if ($(this).scrollTop() > 100) { | if ($(this).scrollTop() > 100) { | ||
- | |||
- | |||
$('#back-top').fadeIn(); | $('#back-top').fadeIn(); | ||
} else { | } else { | ||
- | $('#back- | + | $('#back-top').fadeOut(); |
- | + | ||
- | top').fadeOut(); | + | |
} | } | ||
}); | }); | ||
- | |||
// scroll body to 0px on click | // scroll body to 0px on click | ||
- | |||
- | |||
$('#back-top a').click(function () { | $('#back-top a').click(function () { | ||
$('body,html').animate({ | $('body,html').animate({ | ||
- | |||
- | |||
scrollTop: 0 | scrollTop: 0 | ||
}, 800); | }, 800); | ||
Line 173: | Line 160: | ||
}); | }); | ||
}); | }); | ||
- | |||
}); | }); | ||
</script> | </script> |
Revision as of 04:12, 7 September 2012
NCTU_Formosa