return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>javascript - imagepicker jQuery callback clicked - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - imagepicker jQuery callback clicked - Stack Overflow

programmeradmin2浏览0评论

I am using this / library and I don't know how to show the value of the src image when clicked.

Can you help me?

This is my example:

$("select.image-picker.show-labels").imagepicker({
  hide_select:  true, 
  show_label:   true,
  clicked:function(){
      console.log($(this).find("img").attr("src"));
  }
});

I am using this http://rvera.github.io/image-picker/ library and I don't know how to show the value of the src image when clicked.

Can you help me?

This is my example:

$("select.image-picker.show-labels").imagepicker({
  hide_select:  true, 
  show_label:   true,
  clicked:function(){
      console.log($(this).find("img").attr("src"));
  }
});
Share Improve this question edited Oct 20, 2022 at 21:30 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Jun 18, 2013 at 8:57 jcarloswebjcarlosweb 9742 gold badges15 silver badges34 bronze badges 1
  • the value is undefined, thanks – jcarlosweb Commented Jun 18, 2013 at 9:03
Add a ment  | 

1 Answer 1

Reset to default 7

This should do it :

$(this).find("option[value='" + $(this).val() + "']").data('img-src');

$(this) is the select input, you're trying to find the option which is selected and to get the img-src data attribute.

Though, are you sure you shouldn't just get the Id of the image you selected through $(this).val() ?

发布评论

评论列表(0)

  1. 暂无评论