淘宝SDK倒计时模块如何将倒计时变成个位数的时候在前面加0? 非常感谢!以下是代码:
<divclass="hp10t"><imgsrc="<?phpecho$_MODULE['hp10_a_xml']?$_MODULE['hp10_a_xml']:"as...
<div class="hp10t"><img src="<?php echo $_MODULE['hp10_a_xml']?$_MODULE['hp10_a_xml']:"assets/images/hp10a.gif";?>"/></div>
<div class="hp10a">
<ul>
<?PHP
for($i=1;$i<=$_MODULE['hp10_e_xml'];$i++){
$items=getItems($_MODULE['hp10_id'.$i.'_xml'],310," ",1);
$hdtime=$_MODULE['hp10_time'.$i.'_xml']?$_MODULE['hp10_time'.$i.'_xml']:"0";
$diyimg=$_MODULE['hp10_img'.$i.'_xml'];
foreach($items as $key => $item){
?>
<li>
<div class="hp10_1">
<div class="J_TWidget" data-widget-type="Countdown" data-widget-config="{
'endTime': '<?php echo $hdtime; ?>',
'interval': 1000,
'timeRunCls': '.ks-countdown-run',
'timeUnitCls':{
'd': '.ks-d',
'h': '.ks-h',
'm': '.ks-m',
's': '.ks-s',
'i': '.ks-i'
},
'minDigit': 2,
'timeEndCls': '.ks-countdown-end'
}">
<div class="hp10_1run ks-countdown-run">
<span class="hp6_55"><span class="ks-d time" style="<?php echo $dcolor;?>">0</span><span class="unit">天</span></span>
<span class="hp6_55"><span class="ks-h time" style="<?php echo $dcolor;?>">0</span><span class="unit">时</span></span>
<span class="hp6_55"><span class="ks-m time" style="<?php echo $dcolor;?>">0</span><span class="unit">分</span></span>
<span class="hp6_55" style="margin-right:0;"><span class="ks-s time" style="<?php echo $dcolor;?>">0</span><span class="unit">秒</span></span>
</div>
<div class="hp10_1end ks-countdown-end" style="display:none;">
<span class="hp6_55"><span class="time" style="<?php echo $dcolor;?>">抢购结束!</span><span class="unit">欢迎再来</span></span>
</div>
</div>
</div> 展开
<div class="hp10a">
<ul>
<?PHP
for($i=1;$i<=$_MODULE['hp10_e_xml'];$i++){
$items=getItems($_MODULE['hp10_id'.$i.'_xml'],310," ",1);
$hdtime=$_MODULE['hp10_time'.$i.'_xml']?$_MODULE['hp10_time'.$i.'_xml']:"0";
$diyimg=$_MODULE['hp10_img'.$i.'_xml'];
foreach($items as $key => $item){
?>
<li>
<div class="hp10_1">
<div class="J_TWidget" data-widget-type="Countdown" data-widget-config="{
'endTime': '<?php echo $hdtime; ?>',
'interval': 1000,
'timeRunCls': '.ks-countdown-run',
'timeUnitCls':{
'd': '.ks-d',
'h': '.ks-h',
'm': '.ks-m',
's': '.ks-s',
'i': '.ks-i'
},
'minDigit': 2,
'timeEndCls': '.ks-countdown-end'
}">
<div class="hp10_1run ks-countdown-run">
<span class="hp6_55"><span class="ks-d time" style="<?php echo $dcolor;?>">0</span><span class="unit">天</span></span>
<span class="hp6_55"><span class="ks-h time" style="<?php echo $dcolor;?>">0</span><span class="unit">时</span></span>
<span class="hp6_55"><span class="ks-m time" style="<?php echo $dcolor;?>">0</span><span class="unit">分</span></span>
<span class="hp6_55" style="margin-right:0;"><span class="ks-s time" style="<?php echo $dcolor;?>">0</span><span class="unit">秒</span></span>
</div>
<div class="hp10_1end ks-countdown-end" style="display:none;">
<span class="hp6_55"><span class="time" style="<?php echo $dcolor;?>">抢购结束!</span><span class="unit">欢迎再来</span></span>
</div>
</div>
</div> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询