J查询:在Jira创建问题屏幕中检查自定义字段时应该出现图像弹出窗口?

时间:2013-04-27 17:54:11

标签: javascript jquery jira

我正在搜索一个Jquery函数,它应该获取图像的URL,并且在Jira的创建问题屏幕中检查单选按钮的特定选项时应该出现弹出图像​​。

(function($) {
$('#customfield_12802-1').change(function() {
      alert('Image pop should come, instead of the alert box');

});
$('#customfield_12802-2').change(function() {
  alert('Image pop should come, instead of the alert box');
});
})(AJS.$);

1 个答案:

答案 0 :(得分:0)

我不认为有一个简单的单行jQuery解决方案,但你可以使用插件,Dialog | jQuery UI来做到这一点:

DEMO

<强> HTML:

 <select id = "myList">
     <option value = "1">one</option>
     <option value = "2">two</option>
     <option value = "3">three</option>
     <option value = "4">four</option>
</select>
<div id="dialog"></div>

<强> JS:

$(function() {    
    $('#dialog').html('<img src="/url/to/myImage.png" />')
        .dialog()
        .parent()
        .hide();
  });

$('#myList').change(function() {
      $( "#dialog").dialog().parent().show();
});