$(document).ready(function(){
start();
var pos = 0;
var pos2 = 0;
var bottomh=0;
var bottomm=0;
scroll();
scroll2();
function scroll() {
if (pos < $("#heute")[0].scrollHeight) {
$("#heute").animate({scrollTop: pos}, 1500, function() {
pos = pos + $("#heute").height();
bottomh=0;
$('#heute').load('load/loadh1.php');
$('#morgen').load('load/loadm1.php');
});
} else {
bottomh=1;
if(bottomh==1 && bottomm==1){
$("#heute").animate({scrollTop: 0},1500, function() {
$('#heute').load('load/loadh1.php');
$('#morgen').load('load/loadm1.php');
pos = 0;
});
}
}
setTimeout(scroll, 10000);
}
function scroll2() {
if (pos2 < $("#morgen")[0].scrollHeight) {
$("#morgen").animate({scrollTop: pos2}, 1500, function() {
pos2 = pos2 + $("#morgen").height();
bottomm=0;
$('#heute').load('load/loadh1.php');
$('#morgen').load('load/loadm1.php');
});
} else {
bottomm=1;
if(bottomh==1 && bottomm==1){
$("#morgen").animate({scrollTop: 0},1500, function() {
$('#heute').load('load/loadh1.php');
$('#morgen').load('load/loadm1.php');
pos2 = 0;
});
}
}
setTimeout(scroll2, 10000);
}
});
function start(){
$('#heute').load('load/loadh1.php');
$('#morgen').load('load/loadm1.php');
}