0
當我點擊產品時,它打開了模式並添加到我的產品列表中,但是如果它被添加到我的產品中,我希望特定產品變淡列表和按鈕也是當模式重新打開時,它不能再次添加到列表中。當模式被打開並添加到其他div時淡入li
<script type="text/javascript"> <!--This is the code what i'm able to do so far-->
$(document).ready(function() {
$('button[id^="allttm"]').click(function(e) {
e.preventDefault();
var $this = $(this);
var data_id = $this.attr('data-id');
$("#mylist").append('<li class="has-item">' + data_id + '</li>');
});
});
</script>
<ul class="unstyled" id="products">
<li class="dummycontent" id="itemdetail" data-id="6425809">
<a class="dummyclass" href="javascript:void(0)" id="" data-toggle="modal" data-target="#basicModal">
<span class="itemname">product 1</span>
</a>
</li>
</ul>
<h3 id="myproductlistheader">My productlist</h3>
<ol id="mylist" class="productlist">
</ol>
此模態面積:
<div class="modal fade" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="procuctifo">
<div>
<h3 class="productheading">product 1</h3>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-default" data-dismiss="modal" id="allttm_1" data-id="product 1">Add to list</button>
</div>
</div>
</div>
</div>
你是什麼MEA 'by diable a li'? li沒有禁用的功能?你是否將一件事綁定到了李氏?或者你的意思是裏面的'a'標籤? – atmd
@atmd我意思是淡化它對不起,但禁用模式中的按鈕 –