답변 3개 / 댓글 3개
채택된 답변
+20 포인트
혹시 이런거 말씀하시는건가요?
Copy
<style>body {width:3000px;}#left {cursor:pointer; border:3px dotted lavender; text-align:center; width:50px; height:50px; line-height:50px; position:fixed; top:20px; right:80px;}#right {cursor:pointer; border:3px dotted lavender; text-align:center; width:50px; height:50px; line-height:50px; position:fixed; top:20px; right:20px}</style><script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.min.js" ></script><script>$(document).ready( function() { $("#left").click(function(){ $( 'html, body' ).animate( { scrollLeft : 0 }, 500 ); }); $("#right").click(function(){ $( 'html, body' ).animate( { scrollLeft : $(window).width() }, 500 ); }); });</script><body><div id="left">LEFT</div><div id="right">RIGHT</div></body>
답변을 작성하려면 로그인이 필요합니다.