scrool

1425 단어 OO
function onscorllHandler(){
	$(window).bind("load", function() {
		//alert(1111111111);
		var footerHeight = 0,
		footerTop = 0,
		$footer = $(".footer");
		positionFooter();
		// positionFooter function
		function positionFooter() {
		
		// div#footer 
		footerHeight = $footer.height();
		
		//div#footer 
		footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
		footerTop2 = ($(window).scrollTop()+$(window).height()-footerHeight);
		//alert("top"+footerTop2);
		//alert(footerTop2-300);
		// ,div#footer , div#footer 
		/*if ( ($(document.body).height()+footerHeight) < $(window).height()) {
			$footer.css({
				position: "absolute"
			}).stop().animate({
			top: footerTop
			});
		} else {
			$footer.css({
				position: "static"
			});
		}*/
		
		$footer.css("top",footerTop2);
		}
		$(window).scroll(positionFooter).resize(positionFooter);
	});

}

 
css
/*----- ---absolute--- fixed-*/
.footer {
	position: absolute;
	/*bottom: 0;*/
	left: 0;
	width: 100%;
	z-index: 1;
	border: 0px;
	height: 50px;
}

 
 
 

좋은 웹페이지 즐겨찾기