【问题标题】:jQuery image pickerjQuery 图像选择器
【发布时间】:2010-07-26 21:06:06
【问题描述】:

我正在寻找一个 jQuery 图像选择器插件,它允许我执行以下操作:

  1. 显示一组图像并让用户通过单击选择一个(并且仅一个)
  2. 如果用户不喜欢任何指定的图片,他应该可以上传自己的

只需 #1 就足够了,因为如果需要我可以添加 #2 的代码

我知道这并不难,但如果有一个标准插件可供人们使用,我宁愿使用它也不愿重新发明轮子。

【问题讨论】:

    标签: javascript jquery jquery-plugins


    【解决方案1】:

    我知道这已经得到解答,但我实际上开发了一个库来解决第一个问题。你可以在这里查看:

    http://rvera.github.com/image-picker/

    【讨论】:

      【解决方案2】:

      这样的?我不知道是否有插件,但似乎很简单

      // HTML
      <div id="image_container">
          <img src="blabla" />
          <img src="blabla" />
          ...
      </div>
      <form ...>
          <input id="image_from_list" name="image_from_list" type="hidden" value="" />
          <input id="image_from_file" name="image_from_file" type="file" />
      </form>
      // JS
      $('div#image_container img').click(function(){
          // set the img-source as value of image_from_list
          $('input#image_from_list').val( $(this).attr("src") );
      });
      

      【讨论】:

        【解决方案3】:

        你试过了吗:

        https://code.google.com/p/select-to-image-picker-jquery/

        它允许您将选择框更改为基于 JQueryUI 模态框的图像选择器。

        我一直在寻找这样的东西,最终需要自己开发它。所以也许你也会觉得有用。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2010-12-01
          • 1970-01-01
          • 2010-10-06
          • 2014-06-05
          • 1970-01-01
          • 1970-01-01
          • 2011-02-13
          • 2011-11-14
          相关资源
          最近更新 更多