본문 바로가기
  • think normal
새로워지기/서른의 생활코딩

샘플소스2) javascript 기본 문서구조 ( 문제2_BY jquery 02 )

by 청춘만화 2011. 4. 8.

js 2_5 예제2_BY jquery 02



예제 2를 요즘 잘나간다던 jquery로 구현한다면?  2


<!DOCTYPE html>


<html>


<head>


<meta charset="UTF-8"/>


<title>예제2_BY jquery 02</title>


<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>




<script type="text/javascript">


//<![CDATA[


str = "<ul>";


for (i=1; i<=25; i++) {


str += "<li>" + i + "</li>";


}


str += "</ul>";


document.write(str);




$('ul > li').css("float","left");


$('ul > li').css("list-style","none");


$('ul > li').css("width","60px");


$('ul > li').css("height","60px");


$('ul > li').css("background-color","#dcdcdc");


$('ul > li').css("margin","1px");


$('ul > li').css("text-align","right");


$('ul > li').css("padding","1em .5em 0 0");


$('ul > li').css("font-size","1.2em");


$('ul > li').css("font-weight","bolder");




$('ul > li:nth-child(5n+1)').css("clear", "left");




//]]]]>


</script>


</head>


<body>


</body>


</html>

댓글