Team:UNITN-Trento/JS/Library/onScrollChange
From 2013.igem.org
(Difference between revisions)
(Created page with "/** * onScrollChange (oSch) event handler * @version onScrollChange 1.0 * @copyright Copyright (c) 2010-2012, Gabriele Girelli * @author ggirelli <g.girelli@studenti.unitn.it...") |
|||
(One intermediate revision not shown) | |||
Line 6: | Line 6: | ||
*/ | */ | ||
function oSch(event) { | function oSch(event) { | ||
- | var | + | var lastScroll = $("#tn-main-wrap-wrap").scrollTop(); |
- | + | ||
- | + | ||
- | + | ||
(function listenTime() { | (function listenTime() { | ||
- | var scroll= | + | var scroll = $("#tn-main-wrap-wrap").scrollTop(); |
if (scroll !== lastScroll) { | if (scroll !== lastScroll) { | ||
event(); | event(); |
Latest revision as of 12:37, 19 September 2013
/**
* onScrollChange (oSch) event handler * @version onScrollChange 1.0 * @copyright Copyright (c) 2010-2012, Gabriele Girelli * @author ggirelli <g.girelli@studenti.unitn.it> */
function oSch(event) {
var lastScroll = $("#tn-main-wrap-wrap").scrollTop(); (function listenTime() { var scroll = $("#tn-main-wrap-wrap").scrollTop(); if (scroll !== lastScroll) { event(); lastScroll = scroll; }
var t = setTimeout(listenTime, 100);
})();
}