點選+ 新增 當前行為刪除 新增行為新增
阿新 • • 發佈:2018-11-10
var restep_addi='<i class="iconfont icon-tubiaozhizuomoban restep_addi"></i>';
var restep_deli='<i class="iconfont icon-shanchudelete30 restep_deli"></i>';
var hasnew_table='<div class="reward_steps hasnew_table"><div class="qr_switch"><div class="email_btn1 publish_btns" data-name="" style="position: absolute;"><div class="email_btn2"></div></div></div><div class="restep_text"><span>スタンプ</span><div class="restep_textcon"><input type="tel" name="" value="3" class="restep_stanum"><span>個で</span><input type="text" class="restep_edit restep_addedit" name="" value="" placeholder="ドリンク一杯"><a href="#"><i class="iconfont icon-edit restep_editi"></i></a><i class="iconfont icon-tubiaozhizuomoban restep_addi" style="display:none"></i></div></div></div>';
$(".hasnew_table:last").find(".restep_textcon").append(restep_addi);
function addnew(){
$(this).parent().parent().parent().after(hasnew_table);
$(this). replaceWith(restep_deli);
$(".restep_edit.restep_addedit").on("blur",function(){
$(this).parent().find(".restep_addi").show();
$(this).parent().parent().parent().find(".publish_btns").addClass("publish_open1");
})
$('.restep_addi').unbind('click').bind('click', addnew);
$('.restep_deli').unbind('click').bind('click', delnew);
}
$('.restep_addi').unbind('click').bind('click', addnew);
function delnew(){
$(this).parent().parent().parent().remove();
}
$(".restep_deli").on("click",function(){
delnew();
})