Team:NCTU Formosa/source/head
From 2013.igem.org
(Difference between revisions)
Line 82: | Line 82: | ||
var $this = this, | var $this = this, | ||
$window = $(window); | $window = $(window); | ||
- | + | var tocf = false; | |
$window.scroll(function (e) { | $window.scroll(function (e) { | ||
if ($window.scrollTop() < pos) { | if ($window.scrollTop() < pos) { | ||
Line 88: | Line 88: | ||
position: 'absolute', | position: 'absolute', | ||
top: '0px' | top: '0px' | ||
- | }); | + | });tocf = false; |
} else { | } else { | ||
$this.css({ | $this.css({ | ||
position: 'fixed', | position: 'fixed', | ||
top: '78px' | top: '78px' | ||
- | }); | + | });tocf = true; |
} | } | ||
}); | }); | ||
Line 103: | Line 103: | ||
$(document).scroll(function() { | $(document).scroll(function() { | ||
- | if ($(document).scrollTop() > 800) { | + | if ($(document).scrollTop() > 800 && tocf) { |
if (!away) { | if (!away) { | ||
away = true; | away = true; |
Revision as of 19:21, 15 September 2013