Closed youyouk closed 6 years ago
well, this
is probably not what you expect it to be, from the docs for selected
Specify a function to be called when an option has been selected. Receives the original select as the first argument, the image picker option as the second and the original event as the third argument.
So you will need to recover a ref to whatever you want to access using those params or freeze it in the scope.
Hello, I'm looking for a way to get "this.data('img-src')" of a selected img. Result is always "undefined" :
$("select").imagepicker({ selected: function(option){ var src = this.data('img-src'); alert(src); } });
Thank for your help / advice / reading this message :)