JavaScript [jQuery] 떠있는 레이어 만들기
페이지 정보
본문
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var currentPosition = parseInt( $(".float_layer").css("top"));
$(window).scroll(function() {
var position = $(window).scrollTop();
$(".float_layer").stop().animate
({"top":position+currentPosition+"px"},1000);
});
});
</script>
<style>
.float_layer{position:absolute; top:0px; left:0px;}
</style>
<div class="float_layer">
내용
</div>
참고자료
http://taisou.tistory.com/427
<script type="text/javascript">
$(document).ready(function() {
var currentPosition = parseInt( $(".float_layer").css("top"));
$(window).scroll(function() {
var position = $(window).scrollTop();
$(".float_layer").stop().animate
({"top":position+currentPosition+"px"},1000);
});
});
</script>
<style>
.float_layer{position:absolute; top:0px; left:0px;}
</style>
<div class="float_layer">
내용
</div>
참고자료
http://taisou.tistory.com/427
댓글목록
등록된 댓글이 없습니다.