ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øÃ£±â
ȨÀ¸·Î


ÀÚ¹Ù½ºÅ©¸³Æ® ¿¬½À ¿¹Á¦ - ·£´ýÇÏ°Ô ¿òÁ÷ÀÌ´Â ÅØ½ºÆ® ¸¸µé±â
9³â Àü
<script>
//·£´ýÇÑ Á¤¼ö »ý¼º
function nextRandomInteger(limit) {
        return Math.round(Math.random() * limit);
}

//·£´ýÇÑ ¾ËÆÄºª ¸®ÅÏ
var alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
function randomAlphabet(){
        return alphabet.charAt(nextRandomInteger(25));        
}

//¾ç¼ö¿Í À½¼öÀÇ ·£´ýÇÑ ¼Óµµ »ý¼º
function randomSpeed(maxSpeed){
        return Math.random() * maxSpeed - Math.random() * maxSpeed;
}
</script>

<script>
//Moving TextÀÇ »ý¼ºÀÚ ÇÔ¼ö
var canvasWidth = 700;
var canvasHeight = 400;

function MovingText(){
        this.x = nextRandomInteger(canvasWidth);
        this.y = nextRandomInteger(canvasHeight);
        this.vx = randomSpeed(10);
        this.vy = randomSpeed(10);
        
        //¹®¼­°´Ã¼ »ý¼º
        this.body = document.createElement('h1');
        this.body.innerHTML = randomAlphabet();
        this.body.style.position = 'absolute';
        
        //¹®¼­°´Ã¼¸¦ document.body¿¡ Ãß°¡
        document.body.appendChild(this.body);
}

MovingText.prototype.move = function(){
        //¹üÀ§°Ë»ç
        if(this.x < 0 || this.x > canvasWidth) {this.vx *= -1;}
        if(this.y < 0 || this.y > canvasHeight) {this.vy *= -1;}
        
        //À̵¿
        this.x += this.vx;
        this.y += this.vy;
        
        //È­¸é¿¡ À̵¿Ç¥½Ã
        this.body.style.left = this.x + 'px';
        this.body.style.top = this.y + 'px';
};
</script>

<script>
window.onload = function(){
        var movingTexts = [];
        
        for(var i = 0; i<100; i++){
                movingTexts.push(new MovingText());
        }
        
        setInterval(function(){
                for(var i in movingTexts){
                        movingTexts[i].move();
                }
        }, 1000/60);
};
</script>
ÃßõÃßõ : 348 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,771
Á¤±Ô½Ä ÆÐÅÏ ¹®¹ý
2,770
[Á¤±ÔÇ¥Çö½Ä]Á¤±ÔÇ¥Çö½Ä Á¤¸®
2,769
fopen ¸·ÇûÀ» ¶§ fsocketopen »ç¿ë¹æ¹ý
2,768
[php]¿øÇÏ´Â ´Ü¾î¸¦ ã¾Æ¼­ ġȯ ÇØÁÖ´Â ¹æ¹ý preg_replace
2,767
PHP + MYSQL ¿¬°á Å×½ºÆ® ¿¹Á¦ (mysqli Ŭ·¡½º¹æ½Ä)
2,766
PHP + MYSQL ¿¬°á Å×½ºÆ® ¿¹Á¦ (pdo ¹æ½Ä)
2,765
PHP + MYSQL ¿¬°á Å×½ºÆ® ¿¹Á¦ (original)
2,764
DB Á¢±Ù ¹× Äõ¸®¹®(insert,select,update,delete)
2,763
[MySQL] Çʵ忡¼­ ƯÁ¤¹®ÀÚ Æ÷ÇÔ ¶Ç´Â Á¦¿ÜÇÑ DB °Ë»ö, LIKE ,NOT
2,762
jQuery ÇÙ½É - ³ëµå ´Ù·ç±â
2,761
jQuery show() / hide() / toggle() »ç¿ë¹ý
2,760
[jQuery] readyÀÇ »ç¿ë¹ý
2,759
[jQuery] À§Ä¡±â¹Ý Selector
2,758
[jQuery] css selector
2,757
document.getElementByTagName()¸¦ jQuery·Î ¹Ù²ãº¸ÀÚ.
2,756
getElementsByClassName¸¦ jQuery·Î ¹Ù²ãº¸ÀÚ.
2,755
getElementById¸¦ jQuery·Î ¹Ù²ãº¸ÀÚ
ÀÚ¹Ù½ºÅ©¸³Æ® ¿¬½À ¿¹Á¦ - ·£´ýÇÏ°Ô ¿òÁ÷ÀÌ´Â ÅØ½ºÆ® ¸¸µé±â
2,753
jQuery Mobile¿¡¼­ À¯¿ëÇÑ ÄÚµå 10°¡Áö
2,752
ÀÚ¹Ù½ºÅ©¸³Æ®·Î º¹»çÇϱ⠱â´É ±¸ÇöÇϱâ
2,751
[JqueryMobile] - Jquery Mobile È­¸é °­Á¦ ȸÀü
2,750
jQuery – ½º¸¶Æ®Æù ½ºÅ©¸° ȸÀü °¨Áö ½ºÅ©¸³Æ®
2,749
javascript audioÆÄÀÏ Àç»ý
2,748
javascript º¯¼ö scope shadowing Ŭ·ÎÀú
2,747
javascript ¹Ýº¹¹®
2,746
javascript Á¶°Ç¹®
2,745
javascript ¹è¿­
2,744
javascript ¿¬»êÀÚ¿Í ÇÔ¼ö
2,743
javascript ÀÚ·áÇü
2,742
javascript º¯¼ö
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æÄ§
Copyright ¨Ï musictrot All rights reserved.