Team:NCTU Formosa/source/head
From 2014.igem.org
(Difference between revisions)
(9 intermediate revisions not shown) | |||
Line 5: | Line 5: | ||
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" rel="stylesheet"> | <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" rel="stylesheet"> | ||
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"> | <link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"> | ||
- | <link href='https:// | + | <link href='https://2014.igem.org/Team:NCTU Formosa/css/reset?action=raw&ctype=text/css' rel="stylesheet"> |
- | <link href='https:// | + | <link href='https://2014.igem.org/Team:NCTU Formosa/css/style?action=raw&ctype=text/css' rel="stylesheet"> |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> | ||
- | <link rel="stylesheet" media="only screen and (min-width: 750px)" href="https:// | + | <link rel="stylesheet" media="only screen and (min-width: 750px)" href="https://2014.igem.org/Team:NCTU Formosa/css/style850u?action=raw&ctype=text/css"> |
- | <link rel="stylesheet" media="only screen and (max-width: 750px)" href="https:// | + | <link rel="stylesheet" media="only screen and (max-width: 750px)" href="https://2014.igem.org/Team:NCTU Formosa/css/style850b?action=raw&ctype=text/css"> |
- | <link rel="stylesheet" media="only screen and (max-width: 850px)" href="https:// | + | <link rel="stylesheet" media="only screen and (max-width: 850px)" href="https://2014.igem.org/Team:NCTU Formosa/css/style750u?action=raw&ctype=text/css"> |
- | <link rel="stylesheet" media="only screen and (max-width: 600px)" href="https:// | + | <link rel="stylesheet" media="only screen and (max-width: 600px)" href="https://2014.igem.org/Team:NCTU_Formosa/css/style320b?action=raw&ctype=text/css"> |
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | ||
<script src="https://2013.igem.org/Team:Team:NCTU_Formosa/js/modernizr.custom?action=raw&ctype=text/javascript"></script> | <script src="https://2013.igem.org/Team:Team:NCTU_Formosa/js/modernizr.custom?action=raw&ctype=text/javascript"></script> | ||
Line 80: | Line 80: | ||
$('#toc').stop().css({ | $('#toc').stop().css({ | ||
position: 'fixed', | position: 'fixed', | ||
+ | top: '10px', | ||
left: '-265px' | left: '-265px' | ||
- | } | + | }); |
} | } | ||
+ | var long = false, | ||
+ | dheight = $(document).height(), | ||
+ | wheight = $(window).height(); | ||
+ | if($('#toc').height()+100>wheight) { long=true; } | ||
+ | var away = false; | ||
+ | $(document).scroll(function() { | ||
+ | if ($(document).scrollTop() > dheight/2) { | ||
+ | if (!away) { | ||
+ | if (long){ | ||
+ | away = true; | ||
+ | $('#toc').stop().css({ | ||
+ | position: 'fixed', | ||
+ | top: '0px', | ||
+ | left: '-265px' | ||
+ | }).animate({'top': -22-$('#toc').height()+wheight+'px'}, 500); | ||
+ | }} | ||
+ | } else { | ||
+ | away = false; | ||
if ($(document).scrollTop() < 140){ | if ($(document).scrollTop() < 140){ | ||
$('#toc').stop().css({ | $('#toc').stop().css({ | ||
position: 'absolute', | position: 'absolute', | ||
- | left: '- | + | top: '0px', |
- | } | + | left: '-465px' |
+ | }); | ||
} | } | ||
else { | else { | ||
$('#toc').stop().css({ | $('#toc').stop().css({ | ||
position: 'fixed', | position: 'fixed', | ||
+ | top: '10px', | ||
left: '-265px' | left: '-265px' | ||
- | } | + | }); |
} | } | ||
} | } |
Latest revision as of 17:14, 15 September 2014