jQuery image picker

后端 未结 3 1701
栀梦
栀梦 2021-02-06 05:20

I\'m looking for a jQuery image picker plugin that allows me to do the following:

  1. Display a group of images and let the user select one (and only one) by clicking
相关标签:
3条回答
  • 2021-02-06 05:53

    Something like this? i dont know if there is plugin but is seems really simple

    // 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") );
    });
    
    0 讨论(0)
  • 2021-02-06 05:53

    Have you tried this:

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

    It lets you to change select box into image picker based on JQueryUI modal box.

    I was looking for something like this a long time and finally needed to develop it by myself. So maybe you will find useful too.

    0 讨论(0)
  • 2021-02-06 06:11

    I know this has already been answered but I actually developed a library that address the first problem. You can check it out here:

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

    0 讨论(0)
提交回复
热议问题