定制 xj/yii2-jquery-eraser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xj/yii2-jquery-eraser

最新稳定版本:1.0.0

Composer 安装命令:

composer require xj/yii2-jquery-eraser

包简介

yii2-jquery-eraser

README 文档

README

https://github.com/boblemarin/jQuery.eraser

composer.json

"require": {
    "xj/yii2-jquery-eraser": "~1.0"
},

View

Assets

xj\eraser\EraserAsset::register($this);

Css

.eraser-container {
    position: relative;
    display: inline-block;
    width: 300px;
    height: 200px;
}
#sourceImage {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 1;
    -webkit-box-shadow: 0px 0px 20px 0px #707070;
    -moz-box-shadow: 0px 0px 20px 0px #707070;
    box-shadow: 0px 0px 20px 0px #707070;
}
#coverImage {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 2;
}

Html

<span class="eraser-container">
    <img id="sourceImage" src="/images/eraser/source-image.jpg"/>
    <img id="coverImage" src="/images/eraser/cover-image.jpg"/>
</span>

Js

$('#coverImage').eraser({
    completeRatio: 0.4,
    completeFunction: function(){
        var progress = $('#coverImage').eraser('progress');
        if (progress.toString() !== '1') {
            $('#coverImage').eraser('clear');
        }
    }
});

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-10-08