1

我正在寻找如下所示的图像选择:

https://rvera.github.io/image-picker/

但我不能让它与 Struts2 和 Bootstrap 一起工作,因为图像不显示。

我做了什么:

  • 包括来自 git 的 .js 和 .css
  • 像这样将.js和.css导入我的jsp

    <link href="style/image-picker/image-picker.css" rel="stylesheet"> <script src="style/image-picker/image-picker.js"></script>

  • 将示例复制到我的 jsp

    <select class="image-picker show-html"> <option data-img-src="images/process/xxx.jpg" value="xxx.jpg"> xxx </option> <option data-img-src="images/process/yyy.jpg" value="yyy.jpg"> yyy </option> <option data-img-src="images/process/800_300.png" value="800_300.png"> Default </option> <option data-img-src='http://www.example.com/image.jpg' value='42'> </select>

您是否有更好的图像选择解决方案或如何让图像选择器工作的想法?

4

1 回答 1

0

I know this is an old question, but did you fix it?

You should just call the constructor of the imagepicker and then use the on the select.

$('.image-picker').imagepicker();
于 2016-07-18T07:07:32.740 回答