Skip to content

kairyou/html5-make-thumb

Repository files navigation

html5-make-thumb

Create thumbnail with HTML5.

Useage

<iframe name="ifr" style="display: none;"></iframe> 
<form id="j-form" target="ifr" action="api.php" method="post" enctype="multipart/form-data">
    <input type="file" name="upfile" id="j-file" />
</form>
<script src="jquery.js"></script>
<script src="jquery.make-thumb.js"></script>
var $form = $('#j-form');
var $file = $('#j-file');
$file.makeThumb({
    width: 400,
    height: 400,
    mark: {padding: 5, src: 'mark.png', width: 30, height: 30},
    success: function(dataURL, tSize, file, sSize, fEvt) {
        // post data
        var $up = $('<input type="hidden" name="base64">');
        $up.insertAfter($file).val(dataURL);
        $file.remove();
        $form.submit();
    }
});

中文

reference

About

HTML5 Make thumb

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published