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:1000px; |
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 93: | Line 93: | ||
position: fixed; | position: fixed; | ||
bottom: 30px; | bottom: 30px; | ||
- | margin-left: | + | left: 0px; |
+ | margin-left:1000px; | ||
} | } | ||
#back-top a { | #back-top a { | ||
Line 128: | Line 129: | ||
} | } | ||
#back-top a span { | #back-top a span { | ||
- | background-color: # | + | background-color: #ddd; |
} | } | ||
#back-top a:hover span { | #back-top a:hover span { | ||
- | background-color: # | + | background-color: #eee; |
} | } | ||
</style> | </style> | ||
Line 140: | 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-top').fadeOut(); | + | $('#back- |
+ | |||
+ | 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 159: | Line 173: | ||
}); | }); | ||
}); | }); | ||
+ | |||
}); | }); | ||
</script> | </script> |
Revision as of 04:16, 7 September 2012
NCTU_Formosa