属性添加 jquery after方法

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>产品属性</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/new_style/css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="modpub/js/jquery.js" > </script>

{literal}
<script type="text/javascript">
$(function() {
$("#add_pro_1").click(function(){
var html = "<tr class=''><td class='table_none' style='padding: 10px;'>"+
"<button type='button' class='buto' id='add_pro'>-</button>"+
"型号:"+"<input type='text' name='product_type' id='product_type' value='' size='10' >"+
"活动价:"+"<input type='text' name='product_type' id='product_type' value='' size='10'>"+
"原价:"+"<input type='text' name='product_type' id='product_type' value='' size='10'>"+
"<br /><br /></td></tr>";
$(".af").after(html);

$(this).parent().parent().after(html);
});
});
</script>
<style>
.buto{
width: 37px;
font-size: 17px;
height: 17px;
font-family: -webkit-pictograph;
line-height: 14px;
}
.img-ul{width:100%;float:left;}
.img-ul ul li{width:19%;float:left;margin:1% 0.5%;}
.img-ul ul li img{width:100%;}

</style>
{/literal}

</head>


<body scroll="yes" onload="Init();">

<div class="place">
<ul class="placeul">
<li><a href="#">[管理中心]</a></li>
<li><a href="#">产品管理</a></li>
<li><a href="#">产品属性</a></li>
</ul>
</div>

<form action="index.php?module=RProduct&action=image" method="post" enctype="multipart/form-data">
<input type='hidden' name="id" value="{$id}" />
<br />
<table width="100%" border='0' cellpadding=4 cellspacing=1 align="center" style="text-align: center;">

<tr class="tdTitle" >
<td height="25" align="center" colspan=2>
<font color="#141414" >添加产品属性 </font></td>
</tr>

<tr class="af">
<td class="table_none" style="padding: 10px;">
{foreach from=$pro item=item}
<button type="button" class="buto" id="add_pro_{$item->id}">+</button>
{$item->product_type}:<input type="text" name="product_type" id="product_type" value="" size="10" >
活动价:<input type="text" name="product_type" id="product_type" value="" size="10" >
原价:<input type="text" name="product_type" id="product_type" value="" size="10">
<br />
<br />
{/foreach}
</td>
</tr>
<div id="add_img_list">
<!-- <tr><td class='table_body'></td> <td class='table_none'>
<input type='file' name='photo_dir[]' class='button1' size='15' accept='upload_image/x-png,image/gif,image/jpeg'>

</td>
</tr> -->
</div>
</table>
<div style="text-align:center; margin-top: 10px;">
<input type="submit" value=" 提 交 " class="scbtn"/> &nbsp; &nbsp; &nbsp;
<input type="reset" value=" 重 填 " class="scbtn">&nbsp;&nbsp;&nbsp;
<input type="button" value=" 返 回 " class="scbtn" onclick="location.href='index.php?module=RProduct';">
</div>
</form>

</body>

</html>

 

<include file="Public:head"/>
<script src="tpl/static/upyun.js"></script>
<script type="text/javascript" >
$(document).ready(function(){
$(".copy").live("click",function(){
var num=($(".row_packet").length);
//var img=$(".upload_image").eq(0).html();
var img="<input type='text' name='yhq_money[]' class='px' style='width:100px;'/> "
var html="";
html +='<tr class="row_packet">';
html +='<td><input type="text" name="packet_name[]" class="px" /></td>';
html +="<td class='upload_image'>"
html +=img;
html +="</td>"
html +='<td><input type="text" name="remark[]" value="" class="px" style="width:320px"/></td>';
html +='<td><input type="button" value="追加" class="copy btn btn-primary btn_submit J_ajax_submit_btn"/>&nbsp;&nbsp;<input type="button" value="删除" class="del btn btn-primary btn_submit J_ajax_submit_btn"/></td>';
html +='</tr>';
$(this).parent().parent().after(html);
})
$(".del").live("click",function(){
$(this).parent().parent().remove();
})
})


</script>
<div class="content" style="background:none; border:none; margin-bottom:30px;" >
<div class="cLineB"><h4>添加优惠券红包</h4><a href="javascript:history.go(-1);" class="right btn btn-primary btn_submit J_ajax_submit_btn" style="margin-top:-27px">返回</a>
</div>
<form method="post" action="">

<table class="userinfoArea" style=" margin: 0;" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr >
<th><span class="red">*</span>红包名称:</th>
<th><span class="red">*</span>优惠券金额:</th>
<th>说明:</th>
<th>操作</th>
</tr>
<tr class="row_packet">
<td>
<input type="text" name="packet_name[]" class="px" />
</td>
<td >
<input type="text" name="yhq_money[]" class="px" style="width:100px;" />
</td>
<td>
<input type="text" name="remark[]" value="" class="px" style="width:320px"/>
</td>
<td><input type="button" value="追加" class="copy btn btn-primary btn_submit J_ajax_submit_btn" /></td>
</tr>
<tr>
<td colspan="4">
<button type="submit" id="button" name="button" class="btn btn-primary btn_submit J_ajax_submit_btn">保存</button> <a href="javascript:history.go(-1);" class="btn">取消</a>
</td>
</tr>
</div>
</table>
</form>
</div>
<include file="Public:footer"/>

posted @ 2015-11-13 16:03  流年沉默的如此苍凉╰╮  阅读(308)  评论(0)    收藏  举报