Template:Team:NCTU Formosa/header-safety
From 2012.igem.org
(Difference between revisions)
Line 88: | Line 88: | ||
display:none; | display:none; | ||
} | } | ||
- | + | /* | |
+ | Back to top button | ||
+ | */ | ||
#back-top { | #back-top { | ||
- | position: | + | position: fixed; |
- | + | ||
- | fixed; | + | |
bottom: 30px; | bottom: 30px; | ||
- | + | right:0px; | |
} | } | ||
#back-top a { | #back-top a { | ||
Line 100: | Line 100: | ||
display: block; | display: block; | ||
text-align: center; | text-align: center; | ||
- | + | font: 11px/100% Arial, Helvetica, sans-serif; | |
- | + | ||
- | font: 11px/100% Arial, Helvetica, sans-serif; | + | |
text-transform: uppercase; | text-transform: uppercase; | ||
text-decoration: none; | text-decoration: none; | ||
color: #bbb; | color: #bbb; | ||
- | + | /* background color transition */ | |
- | + | ||
- | /* background color transition */ | + | |
-webkit-transition: 1s; | -webkit-transition: 1s; | ||
-moz-transition: 1s; | -moz-transition: 1s; | ||
transition: 1s; | transition: 1s; | ||
} | } | ||
- | #back-top | + | #back-top a:hover { |
- | + | ||
- | a:hover { | + | |
color: #000; | color: #000; | ||
} | } | ||
Line 122: | Line 116: | ||
width: 81px; | width: 81px; | ||
height: 81px; | height: 81px; | ||
- | + | display: block; | |
- | + | ||
- | display: block; | + | |
margin-bottom: 7px; | margin-bottom: 7px; | ||
- | background: #ddd url(https://static.igem.org/mediawiki/2012/b/b3/Up-arrow.png) no- | + | background: #ddd url(https://static.igem.org/mediawiki/2012/b/b3/Up-arrow.png) no-repeat center center; |
- | + | ||
- | repeat center center; | + | |
/* rounded corners */ | /* rounded corners */ | ||
-webkit-border-radius: 15px; | -webkit-border-radius: 15px; | ||
-moz-border-radius: 15px; | -moz-border-radius: 15px; | ||
- | + | border-radius: 15px; | |
- | + | ||
- | border-radius: 15px; | + | |
/* background color transition */ | /* background color transition */ | ||
-webkit-transition: 1s; | -webkit-transition: 1s; | ||
-moz-transition: 1s; | -moz-transition: 1s; | ||
- | + | transition: 1s; | |
- | + | ||
- | transition: 1s; | + | |
} | } | ||
#back-top a:hover span { | #back-top a:hover span { | ||
Line 146: | Line 132: | ||
} | } | ||
</style> | </style> | ||
- | <script | + | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> |
- | + | ||
- | type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> | + | |
<script> | <script> | ||
Line 157: | Line 141: | ||
// 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(); | |
- | + | ||
- | + | ||
} 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); | ||
return false; | return false; |
Revision as of 03:52, 7 September 2012
NCTU_Formosa