我有一个jQuery input button
,就像下面那个没有触发的jQuery,我无法弄明白为什么。
<input type="button" value="<> Embed" id="embedlink" data-reveal-id="embedpopup" />
然而,如果我这样做,它会发射。为什么会这样?
<a href="javascript:void(0);" id="embedlink" data-reveal-id="embedpopup"><> Embed</a>
jQuery代码:
$(document).on('click', '#embedlink', function(){
if ($("#popupimg iframe").length){
a = $("#popupimg iframe");
var c = a.width();
a = a.height();
}
else{
var a = new Image();
a.src = $("#popupimg img").attr('src');
var c = a.width;
a = a.height;
}
max_closeup_image_width = c;
max_closeup_image_height = a;
$("#EmbedImageWidth").val(c);
$("#EmbedImageHeight").val(a);
$("#EmbedHTMLCode").val(embed_code_html_1 + c + "' height ='" + a + embed_code_html_2);
});