DIR : /home/kozerus/public_html/jkwii/js/jsdoit/jsdoit10/index.js

/home/kozerus/public_html/jkwii/js/jsdoit/jsdoit10

$(function() {

    /**
     *  Atttack button.
     */
    $('#attack').click(function() {

        $('<div class="explode"></div>').appendTo('.effect');
        _lightemit();
        $('#enemy').addClass('start');
    });

    /**
     *  Effect events.
     */
    $('.explode').live('animationend webkitAnimationEnd mozAnimationEnd', function() {
        $(this).remove();
    });

    $('#enemy').bind('animationend webkitAnimationEnd mozAnimationEnd', function() {
        $(this).removeClass('start').addClass('end');
    });
    
    ///////////////////////////////////
    
    function _lightemit() {

        var lights = [],
            x, y, random = Math.random,
            max = 20;

        while (max--) {
            x = (random() * 270 << 0);
            y = (random() * 270 << 0);
            lights.push(
            _createLight().css({
                'top': y, 'left': x
            }).appendTo('.explode'));
        }
    }

    function _createLight() {

        var $light = $('<div class="light" />').bind('animationend webkitAnimationEnd mozAnimationEnd', function() {
            $(this).remove();
        });

        return $light;
    }
});
//


koh5_pano



Your browser does not support the HTML5 canvas element.


Drag mouse to navigate.

Navigation





17.Aug.2010, Martin Wengenmayer