-1
工作流程: 將JSON傳遞給角度範圍並在視圖中使用ng-repeat
來顯示它。jquery對話框不能在圖像上點擊
使用以下函數顯示特定類的元素點擊時的對話框。
$(function() {
$("#dialog").dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "explode",
duration: 1000
}
});
$(".opener").on("click", function() {
$("#dialog").dialog("open");
});
});
$(function() {
$("#imagePopup").dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "explode",
duration: 1000
}
});
想要點擊某個特定類別時觸發它。
<tr ng-repeat="item in ItemList| filter:itemName ">
@*<td>
{{ item.CreatorID}}
</td>*@
<td >
{{item.ItemName}}
</td>
<td >
{{item.CreatorName}}
</td>
<td >
{{item.Length}}
</td>
<td >
{{item.Width}}
</td>
<td >
{{item.Price}}
</td>
<td >
{{item.ItemDescription}}
</td>
<td >
{{item.Quantity}}
</td>
<td >
<div class="opener" style="text-align:center">
<img ng-src="@Url.Content("{{item.ImagePath}}")" width="60" height="60" class="img-responsive img-circle" />
</div>
</td>
<td >
<span class="glyphicon glyphicon-pencil"></span>
</td>
<td >
<span class="glyphicon glyphicon-trash"></span>
</td>
</tr>
</table>
<button class="opener">Opener</button>
<button class="opener">Opener11</button>
<div id="dialog" title="Item Image">
<p>Sample text</p>
</div>
這裏的時候,我就點擊按鈕Opener
& Opener11
彈出窗口,但不會對<div>
點擊它具有相同的類(NG-重複內)。
任何人都可以告訴我,如果我失去了什麼?
是否正在動態添加(頁面被渲染後)的項目? - 在這種情況下,你需要事件代表 –