I create custom widget with select option image but first time selected option image are not showing after saving this function work perfectly,I need this function only load after Drag in sidebar then load function?
jQuery(document).ready(function() {
jQuery('body').on('change', '.selector', change_image);
function change_image(){
var $path = jQuery(this).find('option:selected').val();
jQuery('.image_path').attr('src',$path);
}
});
My jquery function working perfectly in sidebar :). Jquery Enable after Dragging widget in sidebar .