zoukankan      html  css  js  c++  java
  • web前端开发插件(无需重复造轮子)

    1、artdialog 对话框组件

      简介:是一个基于JavaScript编写的对话框组件,他拥有精致的界面与友好的接口

      文档链接:http://www.daimajiayuan.com/download/201304/yulan/artDialog4.1.7/

     2。图片上传

    /*
     * 文件上传实例
     * _this 当前文件上传input节点
     * imgnode  当前父节点
     * localfilename 当前节点 id
     * 火狐、谷歌、ie标准文档模式下可兼容
     */
    function uploadfile_change(that) {
        var _this = $(that);
        var _thisId = $(that).attr("id");
        var result = uploadfileMore1(_this.siblings("div"), $(this).parent(), url_uploadscheduleIMG, _thisId);
    }
    function uploadfileMore1(_this, imgnode,url, localfilename) {
        var hint = $("#" + localfilename).attr("node");//标识
        var filebase64 = "null";
        var jsondata = {};
        var dealdata = {'servicecode': '9003'};
        jsondata.service = dealdata;
        dealdata.watermark = true;
        apiFileupload(url,localfilename, filebase64, jsondata, function (data, status) {
            var json_data = JSON.parse(data);
            if (json_data.status == 0) {
                var data_obj = json_data.data;
                var split = data_obj.url.split(",");
                var div_obj = $(imgnode).parent("div.img_hunk");
                var now_length = div_obj.siblings("div.img_hunk").length;
                var img_str = "";
                if(hint == 2){
                     _this.empty();
                     _this.append('<img class="purls" src="' + split[0] + '" path="' + split[0] + '" style="150px;height:100px;">');
                }else{
                    for (var i = 0; i < split.length; i++) {
                        if (now_length == 0) {
                            if (i <= 7) {
                                img_str += ' <div class="img_hunk img_hunk_other" uuid="">'
                                img_str += '<p><img src="' + split[i] + '" path="' + split[i] + '"></p>';
                                img_str += ' <p>';
                                img_str += '<span class="del_upload_img">删除</span>';
                                img_str += ' </p>';
                                img_str += '</div>';
                                if (i == 7) {
                                    div_obj.hide();
                                }
                            }
                        } else {
                            if (i <= (7 - now_length)) {
                                img_str += ' <div class="img_hunk img_hunk_other" uuid="">'
                                img_str += '<p><img src="' + split[i] + '" path="' + split[i] + '"></p>';
                                img_str += ' <p>';
                                img_str += '<span class="del_upload_img">删除</span>';
                                img_str += ' </p>';
                                img_str += '</div>';
                                if (i == (7 - now_length)) {
                                    div_obj.hide();
                                }
                            }
                        }
                    }
                }
                if (div_obj.siblings("div.img_hunk").html() != undefined) {
                    div_obj.siblings("div.img_hunk:last").after(img_str);
                } else {
                    div_obj.after(img_str);
                }
            }
        });
    }
  • 相关阅读:
    Web--js高级--12月19日随笔
    Web--js高级--12月18日随笔
    Web--js高级--12月17日随笔
    Web--js高级--关于所学闭包随笔
    Web--js高级--12月10日随笔
    Web--js高级--12月4日随笔
    Web--js高级--12月3日随笔
    微信小程序预览图片
    开发微信“小程序”必学教程
    navigator 页面链接
  • 原文地址:https://www.cnblogs.com/nana-share/p/6401271.html
Copyright © 2011-2022 走看看