Jackie

Jackie

2525飞吻 2017-2-17 加入 来自云南昆明

(这个人懒得留下签名)

Jackie 最近的回答

  • 4天前下拉框从数据库中查询数据中回答:

    哪种编程语言
  • 2018-4-13 0:33:42弹出提示框中回答:

    @张灵甫 不客气,我也只是会点简单的,复杂的也不会
  • 2018-4-12 0:11:49弹出提示框中回答:

    你可以去掉输入框的验证属性,自己用jQuery写,然后调用layer组件
  • 2017-12-27 23:42:24HTML 生成Word文档中回答:

    参考: http://www.jq22.com/jquery-info11368
    我的实例代码如下:
                //导出为Word文件
    $("a.jquery-word-export").click(function(event) {
    layer.msg('<img src=images/loading_small.gif> 正在导出Word文件,请稍后...',{
    icon: -1,
    skin: 'layer-ext-moon',
    time: 1000,
    zIndex : 1986111400
    },function(){
    $("#form1").wordExport();
    });

    });

    if (typeof jQuery !== "undefined" && typeof saveAs !== "undefined") {
    (function($) {
    $.fn.wordExport = function(fileName) {
    fileName = typeof fileName !== 'undefined' ? fileName : "<?php echo $row['notice_title']; ?>";
    var static = {
    mhtml: {
    top: "Mime-Version: 1.0\nContent-Base: " + location.href + "\nContent-Type: Multipart/related; boundary=\"NEXT.ITEM-BOUNDARY\";type=\"text/html\"\n\n--NEXT.ITEM-BOUNDARY\nContent-Type: text/html; charset=\"utf-8\"\nContent-Location: " + location.href + "\n\n<!DOCTYPE html>\n<html>\n_html_</html>",
    head: "<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<style>\n_styles_\n</style>\n</head>\n",
    body: "<body>_body_</body>"
    }
    };
    var options = {
    maxWidth: 624
    };
    // Clone selected element before manipulating it
    var markup = $(this).clone();

    // Remove hidden elements from the output
    markup.each(function() {
    var self = $(this);
    if (self.is(':hidden'))
    self.remove();
    });

    // Embed all images using Data URLs
    var images = Array();
    var img = markup.find('img');
    for (var i = 0; i < img.length; i++) {
    // Calculate dimensions of output image
    var w = Math.min(.width, options.maxWidth);
    var h = .height * (w / .width);
    // Create canvas for converting image to data URL
    var canvas = document.createElement("CANVAS");
    canvas.width = w;
    canvas.height = h;
    // Draw image to canvas
    var context = canvas.getContext('2d');
    context.drawImage(, 0, 0, w, h);
    // Get data URL encoding of image
    var uri = canvas.toDataURL("image/png");
    $().attr("src", .src);
    .width = w;
    .height = h;
    // Save encoded image to array
    images[i] = {
    type: uri.substring(uri.indexOf(":") + 1, uri.indexOf(";")),
    encoding: uri.substring(uri.indexOf(";") + 1, uri.indexOf(",")),
    location: $().attr("src"),
    data: uri.substring(uri.indexOf(",") + 1)
    };
    }

    // Prepare bottom of mhtml file with image data
    var mhtmlBottom = "\n";
    for (var i = 0; i < images.length; i++) {
    mhtmlBottom += "--NEXT.ITEM-BOUNDARY\n";
    mhtmlBottom += "Content-Location: " + images[i].location + "\n";
    mhtmlBottom += "Content-Type: " + images[i].type + "\n";
    mhtmlBottom += "Content-Transfer-Encoding: " + images[i].encoding + "\n\n";
    mhtmlBottom += images[i].data + "\n\n";
    }
    mhtmlBottom += "--NEXT.ITEM-BOUNDARY--";

    //TODO: load css from included stylesheet
    var styles = "";

    // Aggregate parts of the file together
    var fileContent = static.mhtml.top.replace("_html_", static.mhtml.head.replace("_styles_", styles) + static.mhtml.body.replace("_body_", markup.html())) + mhtmlBottom;

    // Create a Blob with the file contents
    var blob = new Blob([fileContent], {
    type: "application/msword;charset=utf-8"
    });
    saveAs(blob, fileName + ".doc");
    };
    })(jQuery);
    } else {
    if (typeof jQuery === "undefined") {
    console.error("jQuery Word Export: missing dependency (jQuery)");
    }
    if (typeof saveAs === "undefined") {
    console.error("jQuery Word Export: missing dependency (FileSaver.js)");
    }
    }
  • 2017-12-26 21:29:19关于 layuiAdmin 的价格!!!心伤透了!!!中回答:

    怎么没看到通知,什么时候出来的
  • 2017-12-16 23:30:0基于 layui 的常用开发工具 chrome 插件 中回答:

    无法安装啊,怎么回事

  • 2017-11-21 5:45:4富文本编辑器什么时候更新???中回答:

    之前好像说3.0以后更新
  • 2017-11-1 10:46:29关于layui校验问题中回答:

    取消lay-verify="required"的验证属性就行了啊
  • 2017-10-20 19:12:39layui 一周年中回答:

    恭喜layui周岁了,希望越来越好,越来越多新功能
  • 2017-10-11 10:58:13发现thinkphp和layui是一对啊,我也撮合下中回答:

    @夏季未央 谢谢,抽空学一下
  • 2017-10-11 0:7:50发现thinkphp和layui是一对啊,我也撮合下中回答:

    试了一下,还不错,只是还是小白,没学框架的,暂时用不了,支持下
  • 2017-9-22 0:59:13前方来报,layui 荣获 “码云最有价值开源项目” GVP 认证中回答:

    恭喜贤心[good] [good]
  • 2017-9-22 0:58:29开放 layui 官方交流群中回答:

    自从用了layui,就不想用其他的了
  • 2017-9-14 0:34:33如何将数据库内容写回<富文本编辑器>中回答:

    我的PHP是这样写的:
    <textarea name="article_content" id="article_content" style="display: none;"><?php echo $row['article_content']; ?></textarea>
  • 2017-9-12 21:1:5点击链接或任意元素添加Tab页面中回答:

    @黄金菜头 不知道你用的是否跟我是同一个案例的代码,如果不是,方法可能会不一样