À¥»çÀÌÆ®ÀÇ ¹è°æÀÇ À̹ÌÁö¸¦ ·£´ýÀ¸·Î Ãâ·ÂÀ» ÇÑ´Ù¸é ¹æ¹®ÇÏ´Â »ç¶÷µéµµ Á¶±Ý ´õ Áö·çÇÏ°í
»õ·Î¿î ´À³¦À» ÁÙ ¼ö ÀÖ´Â ÀÚ·áÀÔ´Ï´Ù.
½ºÅ©¸³Æ®ÀÇ À̹ÌÁö °æ·Î¿Í °¹¼ö Àû¿ëÇÒ °÷(id, class) ,ÆÄÀÏÈ®ÀåÀÚ µî ¼³Á¤À¸·Î »ç¿ëÇϱⰡ ½±½À´Ï´Ù.
script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script>
$(document).ready(function(){
var numberOfImages=4;
var imageNum = Math.round(Math.random()*(numberOfImages-1))+1;
var imgPath=('./images/randombg_'+imageNum+'.png');
$('#mainbgs').css('background-image', ('url("'+imgPath+'")'));
});
</script>
<style type="text/css">
#mainbgs {
height: 500px;
padding: 20px 0 0 20px;
font-family: "¸¼Àº °íµñ";
font-size: 20pt;
color: #099;
font-weight: bold;
letter-spacing: -1pt;
background-repeat: no-repeat;
background-position: center top;
}
</style>
-------------------------------------------------------------------
<body>¿¡ »ðÀÔµÈ ³»¿ë
<div id="mainbgs">
¹è°æÀ̹ÌÁö°¡ ·£´ýÇÏ°Ô ¹Ù²î´Â DIV
</div>
ÄÚµåÀÇ »ö»óÀ¸·Î °Á¶µÈºÎºÐÀ» º¸½Ã¸é À̹ÌÁö°¹¼ö, À̹ÌÁö°æ·Î, À̹ÌÁöÈ®ÀåÀÚ, Àû¿ë¿µ¿ª, Çش翵¿ª¿¡ css·Î ¹é±×¶ó¿îµå
Àû¿ëÀ» È®ÀÎÇÏ½Ç ¼ö ÀÖÀ¸¸ç »çÀÌÆ®ÀÇ ¹é±×¶ó¿îµå¿¡ ¾²½Ç·Á¸é ÀûÀýÇÑ css¼öÁ¤Àº ÇÊ¿äÇÕ´Ï´Ù.
»ç¿ëÀںеéÀÇ ¼¾½º¸¦ ¹ØÀ¸¸ç À¯¿ëÇÏ°Ô ¾²½Ã±æ ¹Ù¶ø´Ï´Ù~~
|