0
我正在改變highslide的膨脹機。在擴展器中,我添加了onclick事件,它不起作用。這是我的代碼:onclick高速膨脹機內
hs.Expander.prototype.onBeforeExpand = function (sender, e) {
var div = document.createElement('div');
var txt="<input type='text' name='id_kategorii' value='"+hs_id_kategorii+"' class='pole podpowiedz_kategorie_id' style='width:auto'>"
+"<img class='hs_dodaj_do_kategorii' src='"+global_link+"style/nowy/ik/block--plus.png'>";
$(div).addClass('hs_admin');
$(div).html(txt);
sender.createOverlay({
overlayId: div,
position: "top center",
hideOnMouseOut: false,
opacity: 0.8,
});
$(".hs_admin img").click(function() {
alert('k');
});
$(".hs_admin .podpowiedz_kategorie_id").autocomplete({
source: global_link+"ajax/autocomplete.php?rodzaj=kat",
select: function(event, ui) {
ui.item.value=ui.item.id;
hs_id_kategorii=ui.item.id;
}
});
$(".ui-autocomplete").css("z-index", 1002);};
自動完成工作正常。只有點擊事件不起作用(無警報)。我也試過
<img onclick='alert(\'k'\);'>
結果相同。