Team:UNITN-Trento/JS/Parts

From 2013.igem.org

(Difference between revisions)
Line 1: Line 1:
-
var lastScroll = $(window).scrollTop();
+
var lastScroll = $("#tn-main-wrap-wrap").scrollTop();
alert(lastScroll);
alert(lastScroll);
(function listenTime() {
(function listenTime() {
-
     var scroll = $(window).scrollTop();
+
     var scroll = $("#tn-main-wrap-wrap").scrollTop();
     alert(scroll);
     alert(scroll);
     if (scroll !== lastScroll) {
     if (scroll !== lastScroll) {

Revision as of 12:33, 19 September 2013

var lastScroll = $("#tn-main-wrap-wrap").scrollTop(); alert(lastScroll); (function listenTime() {

   var scroll = $("#tn-main-wrap-wrap").scrollTop();
   alert(scroll);
   if (scroll !== lastScroll) {
       event();
       lastScroll = scroll;
       alert(scroll+" - "+lastScroll);
   }
   var t = setTimeout(listenTime, 100);

})();

$(document).ready(function() { oSch(function() { alert($.scrollTop()); }); });