| 
	
	
		
		
			
			 
				setTimeout
			 
			
		
		
		
		как убить сэтТаймаут? 
 
function anim_go(){ 
	//анимация меню 
	if(menu_y<0){ 
		menu_y+=Math.ceil(menu_y/(-7)); 
		document.getElementById('menu').style.top=menu_y+'  px'; 
	} 
	if(menu_y>=0){ 
		document.getElementById('menu').style.top=0+'px'; 
		a1=1; 
	} 
	//анимация понтов 
	if(pont_y<0){ 
		pont_y+=Math.ceil(pont_y/(-7)); 
		document.getElementById('pont').style.bottom=pont_  y+'px'; 
	} 
	if(pont_y>=0){ 
		document.getElementById('pont').style.bottom=0+'px  '; 
		a2=1; 
	} 
	//анимация дерева_1 
	if(scr_x<0){ 
		scr_x+=Math.ceil(scr_x/(-7)); 
		document.getElementById('back').style.left=scr_x+'  px'; 
		document.getElementById('back_bc').style.left=scr_  x+'px'; 
		document.getElementById('forward').style.right=scr  _x+'px'; 
		document.getElementById('forward_bc').style.right=  scr_x+'px'; 
	} 
	if(scr_x>=0){ 
		document.getElementById('back').style.left=0+'px'; 
		document.getElementById('back_bc').style.left=0+'p  x'; 
		document.getElementById('forward').style.right=0+'  px'; 
		document.getElementById('forward_bc').style.right=  0+'px'; 
		a3=1; 
	} 
	 
	//анимация скролла 
	if(tree_1_y<0){ 
		tree_1_y+=Math.ceil(tree_1_y/(-7)); 
		document.getElementById('tree_1').style.bottom=tre  e_1_y+'px'; 
	} 
	if(tree_1_y>=0){ 
		document.getElementById('tree_1').style.bottom=0+'  px'; 
		a4=1; 
	} 
	if((a1==1)&&(a2==1)&&(a3==1)&&(a4==1)){ 
		anim_stop();	 
	} 
	tmr7=setTimeout(anim_go, 100); 
	 
} 
function anim_stop(){ 
                alert('stop'); 
	clearTimeout(tmr7); 
} 
 
 
алерт нон-стопом срабатывает после выполнения последнего условия первой функции, тоесть как я понимаю таймер 7 не удалился и он постоянно запускает первую функцию, в ней срабатывают все условия, вызывается вротая функция, алерт и опять все поновой. как убить таймер чтобы он не хавал ресурсы компа? 
алерт в последней функции 
		
	
		
		
		
		
		
		
	
		
			
			
	
			
			
			
			
			
				 
			
			
			
			
			
			
				
			
			
			
		 
		
	
	
	 |