如何检查动态删除选项的限制条件? [英] How to check the limit condition for dynamic remove option?
问题描述
嗨朋友们,
感谢您的时间,
i需要帮助,现在我正在创建div (带控件)动态,我也有删除选项,所以即时创建动态删除选项(只是链接)。
现在我想检查条件,用户不能删除每个div,限制是3次,并且还需要设置警报消息,如果他们达到限制。请找到我的代码下面
html
=====
< div class = span3 样式 = margin- removed270px > < a href = #x id = removelink > 删除< / a > < / div >
脚本
=======
< script type = text / javascript>
$( .form-horizontal)。delegate( #removelink, 点击, function (){
$( this )。最近的(' 。optiondiv')。hide(' slow', function (){
$( this )。remove();
resequence();
});
});
< / script>
请帮我解决这个问题。
谢谢: )
( 。form-horizontal).delegate( #removelink, 点击, function (){
( this )。nearest(' 。optiondiv').hide(' slow', function (){
( this )。remove();
resequence();
});
});
< / script>
请帮我解决这个问题。
谢谢: )
Hi friends,
Thanks for your time,
i need help, now im creating div(with controls) dynamically, and also i have remove option for that, so im creating dynamically remove option(just link) also.
now i want to check condition like, user cannot remove every div,limit is 3 times, and also need to set alert message if they reach limit. pls find below my code
html
=====
<div class="span3" style="margin-removed270px"><a href="#x" id="removelink">Remove</a></div>
script
=======
<script type="text/javascript">
$(".form-horizontal").delegate("#removelink", "click", function () {
$(this).closest('.optiondiv').hide('slow', function(){
$(this).remove();
resequence();
});
});
</script>
pls help me to solve this problem.
thanks :)
(".form-horizontal").delegate("#removelink", "click", function () {
(this).closest('.optiondiv').hide('slow', function(){
(this).remove(); resequence(); }); }); </script>
pls help me to solve this problem.
thanks :)
这篇关于如何检查动态删除选项的限制条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!