fullAvatarEditor 头像拍照


本组件需要安装Flash Player后才可使用,请从这里下载安装。

在线实例

实例演示

使用方法

  1.  <div class="container" id="main">
  2.             <div class="demo">
  3.                 <p id="swfContainer">
  4.                     本组件需要安装Flash Player后才可使用,请从<a href="http://dl.pconline.com.cn/html_2/1/114/id=8122&pn=0.html" >这里</a>下载安装。
  5.                 </p>
  6.                 <button type="button" id="upload" style="display:none;margin-top:8px;">swf外定义的上传按钮,点击可执行上传保存操作</button>
  7.             </div>
  8.         </div>
  9.         <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.7.2/jquery.min.js"></script>
  10.         <script type="text/javascript" src="scripts/swfobject.js"></script>
  11.         <script type="text/javascript" src="scripts/fullAvatarEditor.js"></script>
  12.         <script type="text/javascript">
  13.             swfobject.addDomLoadEvent(function() {
  14.                 //以下两行代码正式环境下请删除
  15.                 if (location.href.indexOf('http://') == -1)
  16.                     alert('请于WEB服务器环境中查看、测试!\n\n既 http://*/simpleDemo.html\n\n而不是本地路径 file:///*/simpleDemo.html的方式');
  17.                 var swf = new fullAvatarEditor("fullAvatarEditor.swf", "expressInstall.swf", "swfContainer", {
  18.                     id: 'swf',
  19.                     upload_url: 'upload.php?userid=999&username=looselive', //上传接口
  20.                     method: 'post', //传递到上传接口中的查询参数的提交方式。更改该值时,请注意更改上传接口中的查询参数的接收方式
  21.                     src_upload: 2, //是否上传原图片的选项,有以下值:0-不上传;1-上传;2-显示复选框由用户选择
  22.                     avatar_box_border_width: 0,
  23.                     avatar_sizes: '100*100|50*50|32*32',
  24.                     avatar_sizes_desc: '100*100像素|50*50像素|32*32像素'
  25.                 }, function(msg) {
  26.                     switch (msg.code)
  27.                     {
  28.                         case 1 :
  29. //                            alert("页面成功加载了组件!");
  30.                             break;
  31.                         case 2 :
  32. //                            alert("已成功加载图片到编辑面板。");
  33.                             document.getElementById("upload").style.display = "inline";
  34.                             break;
  35.                         case 3 :
  36.                             if (msg.type == 0)
  37.                             {
  38.                                 alert("摄像头已准备就绪且用户已允许使用。");
  39.                             }
  40.                             else if (msg.type == 1)
  41.                             {
  42.                                 alert("摄像头已准备就绪但用户未允许使用!");
  43.                             }
  44.                             else
  45.                             {
  46.                                 alert("摄像头被占用!");
  47.                             }
  48.                             break;
  49.                         case 5 :
  50.                             if (msg.type == 0)
  51.                             {
  52.                                 if (msg.content.sourceUrl)
  53.                                 {
  54.                                     alert("原图已成功保存至服务器,url为:\n" +  msg.content.sourceUrl + "\n\n" + "头像已成功保存至服务器,url为:\n" + msg.content.avatarUrls.join("\n\n") + "\n\n传递的userid=" + msg.content.userid + "&username=" + msg.content.username);
  55.                                 }
  56.                                 else
  57.                                 {
  58.                                     alert("头像已成功保存至服务器,url为:\n" + msg.content.avatarUrls.join("\n\n") + "\n\n传递的userid=" + msg.content.userid + "&username=" + msg.content.username);
  59.                                 }
  60.                             }
  61.                             break;
  62.                     }
  63.                 }
  64.                 );
  65.                 document.getElementById("upload").onclick = function() {
  66.                     swf.call("upload");
  67.                 };
  68.             });
  69.         </script>

云盘内容


 jQuery插件大全打包

HTML5+CSS3+PHP+jQuery等示例
大小
170M(300+个文件)

注意:示例只是当前的内容,【下载】的是全部jQuery插件一起打包后的文件。

下载地址