开发者

jQuery image picker

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 it
  2. If the user does not like any of the specified images, he should be able to upload his own

Just #1 would suffice, as I can add the code for #2 if necessary

It's not that difficult to do I know, but if there is a standard plugin that people use for this, I'd rather use that than reinvent the wheel.


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/


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") );
});


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜