基礎(chǔ):
1燎潮、href 屬性值是 URL复隆,或者 JavaScript 表達式、方法和函數(shù)的列表。
<a href="javascript:deleteProduct('shoppingProduct_06')">
2、onblur Form事件屬性 元素失去焦點時觸發(fā),用于表單驗證。與 onfocus 屬性相反恋拍。
事件屬性有window、form藕甩、mouse施敢、keyboard、media 狭莱。
<input id="pwd" type="password" class="login_content_input" onFocus="pwdFocus()" onBlur="pwdBlur()">
3僵娃、
<a> 標(biāo)簽創(chuàng)建判斷按鈕
<a style="color: #fff"
onclick="if (confirm('確定要退出嗎?')) return true; else return false;"
href="{$smarty.const.__MODULE__}/Manager/logout" target=_top>退出系統(tǒng)</a>
二級聯(lián)動菜單:
//二級聯(lián)動初始化
function init()
{
//獲取name=province和name=city的元素對象
var province = document.form1.province;
var city = document.form1.city;
//指定province中<option>標(biāo)記的個數(shù)腋妙,添加多少個空的<option>標(biāo)記
var len = arr_province.length;
province.length = len;
//循環(huán)寫入省份數(shù)據(jù)
for(var i=0;i<len;i++)
{
province.options[i].text = arr_province[i];
province.options[i].value = arr_province[i];
}
//更改省份的默認選擇項
var index = 3;
province.selectedIndex = index;
//********************************************************************
//指定city中<option>標(biāo)記的個數(shù)默怨,添加多少個空的<option>標(biāo)記
var len = arr_city[index].length;
city.length = len;
//循環(huán)寫入對應(yīng)城市數(shù)據(jù)
for(var i=0;i<len;i++)
{
city.options[i].text = arr_city[index][i];
city.options[i].value = arr_city[index][i];
}
}
//當(dāng)省份下拉列表被修改,相應(yīng)城市列表中的數(shù)據(jù)也要相應(yīng)變化
function change_select(index)
{
//獲取name=city的元素對象
var city = document.form1.city;
//指定city中<option>標(biāo)記的個數(shù)骤素,添加多少個空的<option>標(biāo)記
var len = arr_city[index].length;
city.length = len;
//循環(huán)寫入對應(yīng)城市數(shù)據(jù)
for(var i=0;i<len;i++)
{
city.options[i].text = arr_city[index][i];
city.options[i].value = arr_city[index][i];
}
}
$("input[name='company_name']").val("");
$("input[type=radio][name=subject_type][value='2']").attr("checked",'checked');
//html與php交互匙睹。html里的if語句
<foreach name="list" item="vo">
<tr>
<td align="center">{$vo.create_time}</td>
<td>{$vo.cnname}</td><!--國際化用的各種語言均查出了-->
<td>{$vo.shop_name}</td>
<td>{$vo.user_id}</td>
<td>{$vo.phone}</td>
<!--<td>{$vo.merchant_level}</td>-->
<!--<td>{$vo.merchant_level}-->
</td>
<!--<td>{$vo['is_recommend']}-->
</td>
<!--<td>{$vo.follower_count}</td>-->
<td <?php if($vo['review_status']==L('REVIEWING')) echo 'style="color:red;"';?>>
{$vo['review_status']}
</td>
<td align="center">
<button type="button" class="btn-link detail" >{:L('MERCHANT_DETAIL')}</button>
<?php if($vo['review_status']==L('VERIFY_PASS')):?>
<button type="button" class="btn-link edit">{:L('EDIT')}<tton>
<?php endif;?>
<!--<button type="button" class="btn-link point_detail" >{:L('PIONT_DETAIL')}</button>-->
</td>
<td>{$vo['creator']}</td>
</tr>
</foreach>
<?php if($info['subject_type']==1):?>
<tr>
<th width="30%">{:L('OBJ_TYPE')}</th>
<td width="70%">{:L('COMPANY')}</td>
</tr>
<tr>
<th width="30%">{:L('COMPANY_NAME')}</th>
<td width="70%"><?php echo $info['company_name']?></td>
</tr>
<tr>
<th width="30%">{:L('BUSINESS_LICENSE_NO')}</th>
<td width="70%"><?php echo $info['business_id']?></td>
</tr>
<?php else:?>
<tr>
<th width="30%">{:L('OBJ_TYPE')}</th>
<td width="70%">{:L('PERSONAL')}</td>
</tr>
<tr>
<th width="30%">{:L('NAME')}</th>
<td width="70%"><?php echo $info['company_name']?></td>
</tr>
<tr>
<th width="30%">{:L('ID_CARD')}</th>
<td width="70%"><?php echo $info['id_number']?></td>
</tr>
<?php endif;?>
及時監(jiān)測input輸入
//監(jiān)測兌換積分數(shù)量輸入框
$("input[name='point_number']").on("input",function () {});
//獲取當(dāng)前日期
var d = new Date();
var day = d.getDate();
多層div疊加顯示并居中(div做假彈出框)
#alertDiv{
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
display:none;
}
#bankInfoDiv{
border:1px solid #999;
background-color:#FFF;
border-radius:5px;
position:absolute;
top:50%;
left:50%;
margin-left:-230px;
margin-top:-135px;
width:460px;
height:270px;
padding:10px 10px;
}
//半透明背景
.bgDiv{
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
background-color:#666;
opacity:0.5;
}
table分隔線設(shè)置
<table border="0" cellspacing="0" cellpadding="0"></table>
table{
width:100%;
border-right:1px solid #999;
border-bottom:1px solid #999;
}
table td{
text-align:center;
padding-left:5px;
padding-right:5px;
font-size:14px;
border-left:1px solid #999;
border-top:1px solid #999;
height: 30px;
}
<a>標(biāo)簽調(diào)用php方法
<a class="btn btn-danger" href="{:U('Eunion/merchantReview')}">{:L('CLEAR')}</a>
form表單請求調(diào)用php方法
<form class="request" method="post" action="{:U('Eunion/exportMerchantReviewList')}" onsubmit="return check()">
<input type="hidden" name="request" value="{:I('request.begin_time')},{:I('request.end_time')},{:I('request.create_time')},{:I('request.status')},{:I('request.region')},{:I('request.key_type')},{:I('request.key_word')}">
</form>
表單內(nèi)詳情按鈕的點擊處理
//詳情頁面
$(".detail").on('click',function () {
var id = $(this.parentNode.parentNode).find("td").eq(3).text();
var region = $(this.parentNode.parentNode).find("td").eq(1).text();
var reviewIndex = layer.open({
title:"{:L('DETAIL')}",
// skin: 'layui-layer-demo', //樣式類名
shift: 2,
type:2,
area: ['860px', '650px'],
shadeClose: false,
content: "{:U(reviewDetail)}&id="+id+"®ion="+region
});
// layer.open({
// skin: 'layui-layer-demo', //樣式類名
// shift: 2,
// shadeClose: true, //開啟遮罩關(guān)閉
// content: html
// });
})