¾È³çÇϼ¼¿ä?
À¥ÆäÀÌÁö¿¡ ¹è°æÀ̹ÌÁö ¿©·¯°³¸¦ ÁغñÇؼ ½Ã°£ÀÌ Áö³²¿¡ µû¶ó ·£´ýÇÏ°Ô º¯ÇÏ°Ô ÇÒ·Á°í ÇÕ´Ï´Ù.
À¥»ó¿¡¼ ¼Ò½º¸¦ Çϳª ã±ä Çߴµ¥, ÀÌ°Ç °æ·Î°¡ ÄÄ»ó¿¡ ÀÖÀ» ¶§¸¦ °¡Á¤Çؼ ¸¸µé¾îÁ® ÀÖ´õ±º¿ä.
------------------------------------------------------------------------------
<html>
<head>
<title>My Wallpaper</title>
<HTA:APPLICATION ID="objHTA" APPLICATIONNAME="My Wallpaper" WINDOWSTATE="maximize" NAVIGABLE="yes">
</head>
<body SCROLL="no" style="position:absolute;width:100%;height:100%;left:0px;top:0px;padding:0px;margin:0px;border:0px;">
<script language="JScript">
var P_INTERVAL = 2000; //2Ãʸ¶´Ù À̹ÌÁö¸¦ ·£´ýÇÏ°Ô ¹Ù²Ù°Ô µË´Ï´Ù. ¾Ë¸Â°Ô Á¶Á¤Çϼ¼¿ä.
//Á¤ÇØÁø ½Ã°£¸¶´Ù ¹Ýº¹ÇÏ¸é¼ ¹è°æ À̹ÌÁö¸¦ ¹Ù²Û´Ù.
function changeImage(){
var arr = getImageList();
var n = Math.floor(Math.random()*arr.length);
document.body.style.background="ivory url("+arr[n]+") no-repeat middle center";
setTimeout("changeImage()", P_INTERVAL);
}
changeImage();
//µð·ºÅ͸®¿¡ ÀÖ´Â À̹ÌÁö ¸®½ºÆ®¸¦ Array ·Î ¹ÝȯÇÑ´Ù.
function getImageList(){
var arr = new Array();
var fso,cnt=0;
fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFolder('d:\\homepage\\page_test\\img'); //À̹ÌÁö Æú´õ ¾Ë¸Â°Ô º¯°æÇϼ¼¿ä. \\ ÀÌ°Å µÎ°Ô ³Ö´Â°Å ÀØÁö ¸¶½Ã±¸¿ä.
var fc = new Enumerator(f.files);
var s = "";
for (; !fc.atEnd(); fc.moveNext()){
var path = String(fc.item());
var ext = path.substring(path.lastIndexOf(".")).toLowerCase();
if(ext=='.jpg'||ext=='.bmp'||ext=='.png'||ext=='.gif'){ //À̹ÌÁöÀÇ È®ÀåÀÚ¸¦ ³ª¿ÇÏ½Ã¸é µË´Ï´Ù.
arr.length = ++cnt;
arr[cnt-1]="file:///"+path;
}
}
return arr;
}
</script>
</body>
</html>
------------------------------------------------------------------------
fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFolder('d:\\homepage\\page_test\\img'); //À̹ÌÁö Æú´õ ¾Ë¸Â°Ô º¯°æÇϼ¼¿ä. \\ ÀÌ°Å µÎ°Ô ³Ö´Â°Å ÀØÁö ¸¶½Ã±¸¿ä.
ÀÌ ºÎºÐÇÏ°í
arr[cnt-1]="file:///"+path;
ÀÌ ºÎºÐÇÏ°í ¶§¹®ÀÎÁö´Â ¸ð¸£°ÚÁö¸¸, °æ·Î°¡ ÄÄ»ó¿¡ ÀÖÀ» ¶§·Î °¡Á¤Çؼ ¸¸µé¾îÁö³×¿ä.
ÀÌ°É À¥»ó¿¡¼µµ ÀÎ½ÄµÇµÇ·Ï ÇÏ°í ½ÍÀºµ¥,
¾î¶»°Ô ÇØ¾ß µÇ´ÂÁö ±Ã±ÝÇÕ´Ï´Ù.
À¥ÆäÀÌÁö¿¡ ¹è°æÀ̹ÌÁö¸¦ ½Ã°£¿¡ µû¶ó ·£´ýÇÏ°Ô ¹Ù²î°Ô ÇØÁÖ´Â ½ºÅ©¸³Æ®°¡ ÀÖ´ÂÁöµµ ±Ã±ÝÇÕ´Ï´Ù.
¸¹Àº µµ¿ò ºÎŹµå¸®±¸¿ä.
ÁÁÀº ÇÏ·ç µÇ¼¼¿ä.