| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2390 人关注过本帖
标题:谁能帮我看一下这个网站商品抢购结束倒计时代码? 为什么不显示
只看楼主 加入收藏
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
结帖率:100%
收藏
已结贴  问题点数:10 回复次数:15 
谁能帮我看一下这个网站商品抢购结束倒计时代码? 为什么不显示
我有个购物网站当首页显示4个商品时,只有第一个商品抢拍倒计时显示正常,下面三个商品倒计时无效,不知道是怎么回事?或谁有更好的方法能实现,谢谢了
图片附件: 游客没有浏览图片的权限,请 登录注册
首页原代码
index.rar (4.23 KB)
谢谢各位了
搜索更多相关主题的帖子: 购物网站 
2011-01-02 20:09
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:0 
replaceText('leftTime220',Dateleft);   
    replaceText('leftTime221',Hourleft);   
    replaceText('leftTime222',Minuteleft);   
    replaceText('leftTime223',Secondleft);
改成:
document.getElementById("leftTime220").innerHTML=Dateleft;
    document.getElementById("leftTime221").innerHTML=Hourleft;
    document.getElementById("leftTime222").innerHTML=Minuteleft;
    document.getElementById("leftTime223").innerHTML=Secondleft;

QQ:63572063
2011-01-02 20:30
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
收藏
得分:0 
谢谢你了,我按照你说的,还是不行
图片附件: 游客没有浏览图片的权限,请 登录注册

图片附件: 游客没有浏览图片的权限,请 登录注册
麻烦高手帮我再看看,谢谢了
2011-01-03 09:52
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
收藏
得分:0 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'##################
'本段asp代码作用为根据不同页面输出不同的子页导航
 dim pagename  
 pagename= "index"
'##################
%>
<!--#include file="webconfig.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%= head_title %></title>
<meta name="Keywords" content="<%=Keywords  %>" />
<meta name="Description" content="<%=Description  %>" />
<link href="styles/index.css" rel="stylesheet" type="text/css" />
<script src="scripts/common.js" type="text/javascript"></script>
<script src="js/ajax.js" type="text/javascript"></script>
<%= head_info %>
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
.STYLE2 {
    color: #FF6600;
    font-weight: bold;
}
.STYLE3 {color: #FF6600}
-->
</style>
</head>
<body>
<div class="container">
  <div class="header">
    <!--#include file="top.asp" -->
  </div>
  <div class="bodier">
    <div class="sidebar">
      <!--#include file="sidebar.asp" -->
    </div>
    <%
dim itype
if not request("itype")="" then
itype=request("itype")
else
itype="美食生活"
end if
set rs_p=server.CreateObject("ADODB.recordset")
sql_p="select top 4 * from product where begintime<=#"&now()&"# and type='"&itype&"' order by begintime desc"
rs_p.open sql_p,conn
%>
<%
'do while not(Rs.EOF )
For j = 1 to 4
%>
    <div class="mainbody">
      <div class="share">
        <ul>
          <script language="JavaScript">
function fastreply(subject) {
if(document.input) {
document.input.subject.value = subject;
document.input.message.focus();
}
}

function copylin()
{
window.clipboardData.setData('text',document.location.href);
alert('复制成功')
}
  </script>
          <li class="msn"><a id="deal-share-im" onclick="copylin()">MSN/QQ</a></li>
          <li class="kaixin"><a href="http://www.("title")%>" rel="skip_external" target="_blank">开心</a></li>
          <li class="renren"> <a title="分享到人人网" class="jiathis_button_renren">人人网</a> </li>
          <script type="text/javascript" src="http://www. charset="utf-8"></script>
          <li class="douban"><a href="http://www.("title")%>" target="_blank">豆瓣</a></li>
          <li class="sina"><a href="http://v.t. target="_blank">新浪微博</a></li>
          <li class="sohu"><a href="http://bai. target="_blank">白社会</a></li>
          <li class="email"><a href="mailto:?body=<%=rs_p("title")%>http://www.("title")%>">邮件</a></li>
          <li class="yphone">
            <script>
             function china_mobile(s,d,e)
             {
              try{}catch(e){}
              var f='http://go.';
              var u=d.location.href+"?id=4049";
              var p=['shareUrl=',e(u),'&title=',e(d.title),'&sid=55ef0c0718677b912f7368585a76afdd'].join('');
              function a(){
               if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,location=0,scrollbars=1,width=800,height=600,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');
              };
               if(/Firefox/.test(navigator.userAgent)){
               setTimeout(a,0)
               }else{
               a()
               }
             }
            </script>
          <a style="cursor:pointer;" onclick="china_mobile(screen,document,encodeURIComponent)" target="_blank">手机</a> </li>
        </ul>
        <div class="c"></div>
        <div class="c qqmsnbox" id="deal-share-im-c" style="display:none"> 把下面的内容通过 MSN 或 QQ 发送给好友:<br />
            <input name="Input" id="invite_url" type="text"  readonly value="<%=rs_p("title")%> http://www. class="intfz" onclick="this.select()"/>
        </div>
      </div>
      <div class="column1">
        <div class="head"></div>
        <div class="body">
          <h1 class="newstitle"><span ><span class="STYLE3">今日团购</span>:</span><a href="product_content.asp?id=<%=rs_p("id")%>"><%=rs_p("title")%></a></h1>
          <div class="side" style="position:relative;">
            <div class="img" style="position: absolute;width:295px; height:96px; left:-125px; ">
              <%
              if rs_p("Number_t")>=rs_p("Number_m") or rs_p("lasttime")<now() then
              
              %>
              <img src="images/js.jpg" width="295" height="96" />
              <%else%>
              <form <%if not session("m_id")="" then%>action="buy.asp"<%else%>action="login.asp"<%end if%> method="post" name="form_buy">
                <input name="title" type="hidden" value="<%=rs_p("title")%>"/>
                <input name="price" type="hidden" value="<%=rs_p("price4")%>"/>
                <input name="endtime" type="hidden" value="<%=rs_p("endtime")%>"/>
                <input name="c_id" type="hidden" value="<%=rs_p("c_id")%>"/>
                <input name="p_id" type="hidden" value="<%=rs_p("id")%>"/>
                <input name="submit" src="images/fudingjin.jpg" width="295" height="96" type="image" />
              </form>
              <%end if%>
              <span style="position:absolute; left:102px; color:#fff; font-size:30px; top:17px; z-index:2;">¥<%=rs_p("price4")%></span> </div>
            <div class="boxs">
              <div class="jiage">
                <dl>
                  <dt>原价</dt>
                  <dd><strike><span class="STYLE1">¥<%=rs_p("price1")%></span></strike></dd>
                </dl>
                <dl>
                  <dt>折扣</dt>
                  <dd><%=Formatnumber(rs_p("zhekou"),1,-1,-1,0)%>折</dd>
                </dl>
                <dl>
                  <dt>节省</dt>
                  <dd>¥<%=rs_p("price3")%></dd>
                </dl>
              </div>
            </div>
            <div class="boxs">
              <%if rs_p("Number_t")>=rs_p("Number_m") or rs_p("lasttime")<now() then%>
              <div class="jieshu">距离本次团购已于<%=FormatDateTime(rs_p("lasttime"),1)%>&nbsp;<%=FormatDateTime(rs_p("lasttime"),4)%>结束</div>
              <%else%>
              <%
If IsDate(rs_p("lastTime")) Then
yy = CStr(Year(rs_p("lastTime")))
y = Mid(CStr(Year(rs_p("lastTime"))),3)
m = CStr(Month(rs_p("lastTime")))
If Len(m) = 1 Then m = "0" & m
d = CStr(Day(rs_p("lastTime")))
If Len(d) = 1 Then d = "0" & d
h = CStr(Hour(rs_p("lastTime")))
If Len(h) = 1 Then h = "0" & h
mi = CStr(Minute(rs_p("lastTime")))
If Len(mi) = 1 Then mi = "0" & mi
s = CStr(Second(rs_p("lastTime")))
If Len(s) = 1 Then s = "0" & s
End If

%>
              <div class="jieshu">距本次团购结束还有: <span id='leftTime220'></span>天<span id='leftTime221'></span>小时<span id='leftTime222'></span>分<span id='leftTime223'></span>秒</div>
              <script type="text/javascript">
<!--   
startclock();   
var timerID = null;   
var timerRunning = false;     
function showtime() {
    Today = new Date();   
    var NowHour = Today.getHours();   
    var NowMinute = Today.getMinutes();   
    var NowMonth = Today.getMonth();   
    var NowDate = Today.getDate();   
    var NowYear = Today.getYear();   
    var NowSecond = Today.getSeconds();   
    if (NowYear <2000){  
        NowYear=1900+NowYear;   
    }
    Today = null;   
    Hourleft = <%=h%>- NowHour   
    Minuteleft = <%=mi%>- NowMinute   
    Secondleft = <%=s%> - NowSecond   
    Yearleft = <%=yy%> - NowYear   
    Monthleft = <%=m%> - NowMonth - 1   
    Dateleft = <%=d%>- NowDate   
    if (Secondleft<0) {   
        Secondleft=60+Secondleft;   
        Minuteleft=Minuteleft-1;   
    }   
    if (Minuteleft<0){   
        Minuteleft=60+Minuteleft;   
        Hourleft=Hourleft-1;   
    }   
    if (Hourleft<0){   
        Hourleft=24+Hourleft;   
        Dateleft=Dateleft-1;   
    }   
    if (Dateleft<0){   
        Dateleft=31+Dateleft;   //todo
        Monthleft=Monthleft-1;   
    }   
    if (Monthleft<0){   
        Monthleft=12+Monthleft;   
        Yearleft=Yearleft-1;   
    }
   
    replaceText('leftTime220',Dateleft);   
    replaceText('leftTime221',Hourleft);   
    replaceText('leftTime222',Minuteleft);   
    replaceText('leftTime223',Secondleft);  
    timerID = setTimeout("showtime()",1000);   
    timerRunning = true;   
}
function stopclock () {   
    if(timerRunning) {  
        clearTimeout(timerID);   
    }
    timerRunning = false;   
}   
function startclock () {   
    stopclock();   
    showtime();   
}   
// -->
  </script>
              <%end if%>
            </div>
            <%if rs_p("Number_t")>=rs_p("Number_m") or rs_p("lasttime")<now() then%>
            <div style="border:1px solid #CBCBCB; background:#fcecc8; margin-bottom:10px; padding:28px 0 " ><img src="images/empty.png" width="165"   /></div>
            <%else%>
            <div class="boxs">
              <div class="renshu"><strong>已经有<%=rs_p("Number_t")%>人购买</strong>
                  <% If rs_p("Number_l") > rs_p("Number_t") Then %>
                  <div class="huatiao">
                    <%
                sw=Formatnumber(rs_p("Number_t")*140/rs_p("Number_l"),0,-1,-1,0)
                %>
                    <p style="background-position:<%=sw%>px 0;">
                      <!-- background-position:25px 200px 乘以百分比  -->
                    </p>
                    <ul style="margin-top:5px; line-height:15px; height:15px;">
                      <span style="float:right;"><%=rs_p("Number_l")%></span><span><%=rs_p("Number_t")%></span>
                    </ul>
                  </div>
                <p>尚未到达团购人数!</p>
                <% Else %>
                  <div class="chenggong"><img src="images/gou.jpg" width="30" height="30" style="vertical-align:middle; margin-right:10px;" />团购已成功,还可以继续购买!</div>
                <p><%=FormatDateTime(rs_p("succsstime"),3)%>到达</p>
                <p>最低团购人数<%=rs_p("Number_l")%>人!</p>
                <% End If %>
              </div>
            </div>
            <%end if%>
          </div>
          <div class="main">
            <div class="datu">
              <div class="image"><img src="eweb_upload/tuangou/<%=rs_p("photo")%>" width="517" height="364" /></div>
              <p class="text"><%=rs_p("content1")%></p>
            </div>
            
          </div>
         
          <div class=" clearfloat"></div>
        </div>
     
        <div class="foot"></div>
        
      </div>
      
    </div>
          <%
Rs_p.MoveNext
'loop
If rs_p.EOF Then Exit For
next

rs_p.close
set rs_p=nothing

%>
  </div>
  <div class="footer">
  
    <!--#include file="bottom.asp" -->
  </div>
</div>
</body>
</html>
2011-01-03 09:59
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:0 
程序代码:
 <%Dim lastTime

 lastTime=now+3
If IsDate(lastTime) Then
yy = CStr(Year(lastTime))
y = Mid(CStr(Year(lastTime)),3)
m = CStr(Month(lastTime))
If Len(m) = 1 Then m = "0" & m
d = CStr(Day(lastTime))
If Len(d) = 1 Then d = "0" & d
h = CStr(Hour(lastTime))
If Len(h) = 1 Then h = "0" & h
mi = CStr(Minute(lastTime))
If Len(mi) = 1 Then mi = "0" & mi
s = CStr(Second(lastTime))
If Len(s) = 1 Then s = "0" & s
End If 

%>
              <div class="jieshu">距本次团购结束还有: <span id='leftTime220'></span><span id='leftTime221'></span>小时<span id='leftTime222'></span><span id='leftTime223'></span></div>
              <script type="text/javascript">
<!--  
startclock();  
var timerID = null;  
var timerRunning = false;    
function showtime() {
    Today = new Date();  
    var NowHour = Today.getHours();  
    var NowMinute = Today.getMinutes();  
    var NowMonth = Today.getMonth();  
    var NowDate = Today.getDate();  
    var NowYear = Today.getYear();  
    var NowSecond = Today.getSeconds();  
    if (NowYear <2000){ 
        NowYear=1900+NowYear;  
    }
    Today = null;  
    Hourleft = <%=h%>- NowHour  
    Minuteleft = <%=mi%>- NowMinute  
    Secondleft = <%=s%> - NowSecond  
    Yearleft = <%=yy%> - NowYear  
    Monthleft = <%=m%> - NowMonth - 1  
    Dateleft = <%=d%>- NowDate  
    if (Secondleft<0) {  
        Secondleft=60+Secondleft;  
        Minuteleft=Minuteleft-1;  
    }  
    if (Minuteleft<0){   
        Minuteleft=60+Minuteleft;  
        Hourleft=Hourleft-1;  
    }  
    if (Hourleft<0){  
        Hourleft=24+Hourleft;  
        Dateleft=Dateleft-1;  
    }  
    if (Dateleft<0){  
        Dateleft=31+Dateleft;   //todo
        Monthleft=Monthleft-1;  
    }  
    if (Monthleft<0){  
        Monthleft=12+Monthleft;  
        Yearleft=Yearleft-1;  
    }
    document.getElementById("leftTime220").innerHTML=Dateleft;
    document.getElementById("leftTime221").innerHTML=Hourleft;
    document.getElementById("leftTime222").innerHTML=Minuteleft;
    document.getElementById("leftTime223").innerHTML=Secondleft;
    //replaceText('leftTime220',Dateleft);  
    //replaceText('leftTime221',Hourleft);  
   // replaceText('leftTime222',Minuteleft);  
   // replaceText('leftTime223',Secondleft); 
    timerID = setTimeout("showtime()",1000);  
    timerRunning = true;  
}
function stopclock () {  
    if(timerRunning) { 
        clearTimeout(timerID);  
    }
    timerRunning = false;  
}  
function startclock () {  
    stopclock();  
    showtime();  
}  
// -->
  </script>
这个试下。可以呀。

QQ:63572063
2011-01-03 12:12
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
收藏
得分:0 
非常感谢楼上的朋友关注我的问题,但自己是菜鸟,还没解决这个问题,希望朋友能留个邮箱,或qq我把整个源码发给你你帮我调试一下,再次不胜感激了,我的邮箱hhwz800@
2011-01-03 13:32
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:0 
If IsDate(rs_p("lastTime")) Then
这句可能有问题,没有获得时间。
-》
<%Dim lastTime
lastTime=rs_p("lastTime“)
lastTime=Cdate(lastTime)
If IsDate(lastTime) Then
yy = CStr(Year(lastTime))
y = Mid(CStr(Year(lastTime)),3)
m = CStr(Month(lastTime))
If Len(m) = 1 Then m = "0" & m
d = CStr(Day(lastTime))
If Len(d) = 1 Then d = "0" & d
h = CStr(Hour(lastTime))
If Len(h) = 1 Then h = "0" & h
mi = CStr(Minute(lastTime))
If Len(mi) = 1 Then mi = "0" & mi
s = CStr(Second(lastTime))
If Len(s) = 1 Then s = "0" & s
End If

%>
这样改试下,

QQ:63572063
2011-01-03 18:11
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
收藏
得分:0 
这样改了还是不行。提示无效字符
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册
2011-01-04 10:14
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:0 
rs_p("lastTime“)
这个打错了。!
rs_p("lastTime")

QQ:63572063
2011-01-04 12:30
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
收藏
得分:0 
这个地方我看到了,我已经修改了,还是那个无效字符的提示。朋友请让我把源码发给你你吧!
2011-01-04 13:48
快速回复:谁能帮我看一下这个网站商品抢购结束倒计时代码? 为什么不显示
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.055559 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved