Resources/Message Styles/Renkoo.AdiumMessageStyle/Contents/Resources/Footer.html
branchfix-autoscroll
changeset 5995 2bfcb17b7076
parent 3552 40cac356e9ea
equal deleted inserted replaced
5989:1b816aafafdd 5995:2bfcb17b7076
   182 		//document.body.scrollTop = (document.body.scrollHeight-window.innerHeight);
   182 		//document.body.scrollTop = (document.body.scrollHeight-window.innerHeight);
   183 		//return;
   183 		//return;
   184 		if ( intervall_scroll ) clearInterval( intervall_scroll );
   184 		if ( intervall_scroll ) clearInterval( intervall_scroll );
   185 		intervall_scroll = setInterval( function() {
   185 		intervall_scroll = setInterval( function() {
   186 			var target_scroll = (document.body.scrollHeight-window.innerHeight);
   186 			var target_scroll = (document.body.scrollHeight-window.innerHeight);
   187 			var scrolldiff = target_scroll - document.body.scrollTop;
   187 			var scrolldiff = target_scroll - window.scrollY;
   188 			if ( document.body.scrollTop != target_scroll ) {
   188 			if ( window.scrollY != target_scroll ) {
   189 				var saved_scroll = document.body.scrollTop;
   189 				var saved_scroll = window.scrollY;
   190 				document.body.scrollTop += scrolldiff / 5 + ( scrolldiff >= 0 ? (scrolldiff != 0 ) : -1 );
   190 				window.scrollTo(0, window.scrollY + scrolldiff / 5 + ( scrolldiff >= 0 ? (scrolldiff != 0 ) : -1 ));
   191 			} else {
   191 			} else {
   192 				saved_scroll = -1;
   192 				saved_scroll = -1;
   193 				clearInterval( intervall_scroll );
   193 				clearInterval( intervall_scroll );
   194 			}
   194 			}
   195 		} , 10 );
   195 		} , 10 );