GitXplorerGitXplorer
b

Spify

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
7022bbd1406787a6b24f515a1eb134ecf1a9b194

Поправил README

bbelozer committed 10 years ago
Unverified
f57f67f9202a5c361abca48b7df50e94152170cb

Удалил невнимательность

bbelozer committed 10 years ago
Unverified
d6b2509d1a52c5c4992d4f3ecf2281b8d99f9895

Исправил невнимательность

bbelozer committed 10 years ago
Unverified
05c2cb6a7e2a1be9d94d8ac57a735e488a76d7c0

Обновил demo page

bbelozer committed 10 years ago
Unverified
e376a9db26b8503beebcad31645f837ae7b5acdb

Spify

bbelozer committed 10 years ago
Unverified
2b4c6e0e7f5b2ee3687d1e5846ba4b4e4a6790f1

Обновил README

bbelozer committed 10 years ago

README

The README file for this repository.

alt tag

Description

Light (Spify < 2 Kb) and sample jQuery plugin for sprite animations

1.Getting Started

Load jQuery and include spify plugin

<script src="jquery.js"></script>
<script src="jquery.spify.min.js"></script>

2.Set up your HTML

<div class="animation"></div>

or with data-* options

<div class="animation"
    data-size="100,100"
    data-count="4"
    data-duration="500"
    data-url="sprite.png">
</div>

3.Call the plugin

With JS params

$(".animation").spify({
    size: [100, 100],
    count: 4,
    duration: 500,
    url: 'sprite.png'
});

If is set data-* options initialize animation very easy

$(".animation").spify();

Options

    /* Required */

    url:      string        // Url to sprite image

    size:     array         // Size frame
                            // js: [width, height]
                            // html: "width, height"

    count:    int           // Count frames


    /* Extanded */

    duration: int           // Duration for each frame
                            // Default: 300

    durations: object       // Duration for individual frames
                            // Example
                            // js: {1: 300, 3: 2000}
                            // html: "1: 300, 3: 2000"

    vector:   string        // Position frames in sprite (vertical or horizontal)
                            // Default: vertical

Design sprite

 _______________________________________
|         |         |         |         |
|    1    |    2    |    3    |   ...   | // horizontal
|_________|_________|_________|_________|

 _________
|         |
|    1    |
|_________|
|         |
|    2    |
|_________|  // vertical
|         |
|    3    |
|_________|
|         |
|   ...   |
|_________|

License

The MIT License (MIT)

Copyright (c) 2014 Sergey Belozyorcev