【问题标题】:Show image in bootstrap upload image with jquery使用 jquery 在引导上传图像中显示图像
【发布时间】:2017-06-05 03:13:06
【问题描述】:

我使用bootstrap image upload。我想使用 JQuery 在预览中显示默认图像,如果用户不浏览任何图像,则该图像已上传。我该怎么做?

【问题讨论】:

    标签: jquery image twitter-bootstrap upload preview


    【解决方案1】:

    你可以使用http://plugins.krajee.com/file-advanced-usage-demo

     $("#input-24").fileinput({
            initialPreview: [
                'http://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/FullMoon2010.jpg/631px-FullMoon2010.jpg',
                'http://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Earth_Eastern_Hemisphere.jpg/600px-Earth_Eastern_Hemisphere.jpg'
            ],
            initialPreviewAsData: true,
            initialPreviewConfig: [
                {caption: "Moon.jpg", size: 930321, width: "120px", key: 1},
                {caption: "Earth.jpg", size: 1218822, width: "120px", key: 2}
            ],
            deleteUrl: "/site/file-delete",
            overwriteInitial: false,
            maxFileSize: 100,
            initialCaption: "The Moon and the Earth"
        });
    

    【讨论】:

      猜你喜欢
      • 2015-06-02
      • 1970-01-01
      • 2017-12-07
      • 1970-01-01
      • 2015-10-09
      • 1970-01-01
      • 2013-01-27
      • 2018-09-07
      • 1970-01-01
      相关资源
      最近更新 更多