:php团购倒计时如何做?

WBOY
Release: 2016-06-13 13:51:32
Original
839 people have browsed it

请教高手:php团购倒计时怎么做??
不同的商品显示不同的倒计时,团购开始时间和结束时间可以动态设置??请高手指点,谢谢!!!

------解决方案--------------------
结束时间是固定的,再用JS倒计时呗
------解决方案--------------------
往HTML 输出确定的时间,然后 用JS做倒计时。。我这有个倒计时的。。。
我这个是跳转网页的。。大概思路你看看吧

JScript code
<script type="text/javascript">   
<!--   
function go(t,url){   
//t设置跳转时间:秒   
//url设置跳转网址   
document.write("<div id=text>本页将在<strong id=tt>后,跳转至:<span id=link>");   
document.getElementById("link").innerHTML="<a href="+url+">"+url+"";   
$(t,url);   
}   
  
function $(t,url){   
ta = t-1;   
tb = t+"000";   
d = document.getElementById("tt");   
d.innerHTML=t;   
  
window.setInterval(function()   
    {   
        go_to(url);   
    },1000);   
}   
  
function go_to(url){   
d.innerHTML=ta--;   
if(ta<0){   
document.write("正在跳转至:<a href="+url+">"+url+"");   
location.href=url;   
}   
else{   
return;   
}   
}   
//-->   
</script>  
<script type="text/javascript">  
go(5,"s.php")   
</script> <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!