我正在使用Jssor滑块并已经实现了一些经典的asp,以便从访问数据库中提取图像和其他一些东西。它完美地拉出第一张图像,但永远不会转到第二张图像。
我可以使用<%rs.movenext%>但如果我使用<%rs.movenext loop%>页面崩溃。
我已经为此工作了3天,似乎无法弄明白,所以任何帮助都会非常感激。
下面的是页面代码的副本。
<!DOCTYPE html>
<!--#include file="dbconnect.asp"-->
<html>
<head>
<title>Banner Rotator Demo - Jssor Slider, Slideshow with Javascript Source Code</title>
</head>
<body style="background:#fff;">
<style>
.captionOrange, .captionBlack
{
color: #fff;
font-size: 20px;
line-height: 30px;
text-align: center;
border-radius: 4px;
}
.captionOrange
{
background: #EB5100;
background-color: rgba(235, 81, 0, 0.6);
}
.captionBlack
{
font-size:16px;
background: #000;
background-color: rgba(0, 0, 0, 0.4);
}
a.captionOrange, A.captionOrange:active, A.captionOrange:visited
{
color: #ffffff;
text-decoration: none;
}
a.captionOrange:hover
{
color: #eb5100;
text-decoration: underline;
background-color: #eeeeee;
background-color: rgba(238, 238, 238, 0.7);
}
.bricon
{
background: url("../img/browser-icons.png");
}
</style>
<!-- it works the same with all jquery version from 1.3.1 to 2.0.3 -->
<script type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
<!-- use jssor.slider.mini.js (39KB) or jssor.sliderc.mini.js (31KB, with caption, no slideshow) or jssor.sliders.mini.js (26KB, no caption, no slideshow) instead for release -->
<!-- jssor.slider.mini.js = jssor.sliderc.mini.js = jssor.sliders.mini.js = (jssor.core.js + jssor.utils.js + jssor.slider.js) -->
<script type="text/javascript" src="../js/jssor.core.js"></script>
<script type="text/javascript" src="../js/jssor.utils.js"></script>
<script type="text/javascript" src="../js/jssor.slider.js"></script>
<%
strSQLQuery = "SELECT * FROM SliderImages where i_active = true"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQLQuery, conn, 3, 3
if not rs.eof then
'rs.movenext
'loop
%>
<div id="slider1_container" style="position: relative; width: 1040px;
height: 300px;">
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;">
</div>
<div style="position: absolute; display: block; background: url('../img/loading.gif') no-repeat center center;
top: 0px; left: 0px;width: 100%;height:100%">
</div>
</div>
<%' if rs("i_active") = "True" then %>
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 1040px; height: 300px;
overflow: hidden;">
<% if rs("i_href") > " " then %>
<div>
<a u=image href=""><img src="/images/slider/<%=rs("i_image")%>" width="1040" height="300" /></a>
<% if rs("i_box") = "True" then %>
<div u=caption t="*" class="captionOrange" style="position:absolute; left:20px; top: 30px; width:300px; height:30px;">
<% =rs("b_text") %>
</div>
<% end if %>
</div><% 'rs.movenext 'loop %>
<% else %>
<div>
<img src="/images/slider/<%=rs("i_image")%>" width="1040" height="300" />
<% if rs("i_box") = "True" then %>
<div u=caption t="*" class="captionOrange" style="position:absolute; left:20px; top: 30px; width:300px; height:30px;">
<% =rs("b_text") %>
</div>
<% end if %>
</div><% rs.movenext 'loop %>
</div>
<style>
/*
.jssorn01 div (normal)
.jssorn01 div:hover (normal mouseover)
.jssorn01 .av (active)
.jssorn01 .av:hover (active mouseover)
.jssorn01 .dn (mousedown)
*/
.jssorn01 div, .jssorn01 div:hover, .jssorn01 .av
{
filter: alpha(opacity=70);
opacity: .7;
overflow:hidden;
cursor: pointer;
border: #000 1px solid;
}
.jssorn01 div { background-color: gray; }
.jssorn01 div:hover, .jssorn01 .av:hover { background-color: #d3d3d3; }
.jssorn01 .av { background-color: #fff; }
.jssorn01 .dn, .jssorn01 .dn:hover { background-color: #555555; }
</style>
<div u="navigator" class="jssorn01" style="position: absolute; bottom: 16px; right: 10px;">
<!-- navigator item prototype -->
<div u="prototype" style="POSITION: absolute; WIDTH: 12px; HEIGHT: 12px;"></div>
</div>
<style>
/* jssor slider direction navigator skin 05 css */
/*
.jssord05l (normal)
.jssord05r (normal)
.jssord05l:hover (normal mouseover)
.jssord05r:hover (normal mouseover)
.jssord05ldn (mousedown)
.jssord05rdn (mousedown)
*/
.jssord05l, .jssord05r, .jssord05ldn, .jssord05rdn
{
position: absolute;
cursor: pointer;
display: block;
background: url("../img/d17.png") no-repeat;
overflow:hidden;
}
.jssord05l { background-position: -10px -40px; }
.jssord05r { background-position: -70px -40px; }
.jssord05l:hover { background-position: -130px -40px; }
.jssord05r:hover { background-position: -190px -40px; }
.jssord05ldn { background-position: -250px -40px; }
.jssord05rdn { background-position: -310px -40px; }
</style>
<span u="arrowleft" class="jssord05l" style="width: 40px; height: 40px; top: 123px; left: 8px;"><img src="/images/slider/prev.png" width: "40px"; height: "40px"/>
</span>
<span u="arrowright" class="jssord05r" style="width: 40px; height: 40px; top: 123px; right: 8px"><img src="/images/slider/next.png" width: "40px"; height: "40px" />
</span>
<a style="display: none" href="">jQuery Carousel</a>
</div>
<% end if %>
<% 'on error resume next %>
<% rs.movenext %>
<% 'loop %>
<% end if %>
<% 'wend %>
</body>
</html>
答案 0 :(得分:0)
<% rs.movenext loop %>
无效。它们是两个独立的命令,因此如果在同一行上,它们必须用冒号分隔,如下所示:<% rs.movenext : loop %>
但是你的代码中似乎没有循环的第一部分。您需要在要为每条记录循环的代码的开头添加执行命令。
将<% Do Until rs.EOF %>
放在要循环的代码的开头,将<% Loop %>
放在要循环的代码的末尾。
我猜你想要改变部分代码:
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 1040px; height: 300px; overflow: hidden;">
<% Do Until rs.EOF %>
<% if rs("i_href") > " " then %>
<div>
<a u=image href=""><img src="/images/slider/<%=rs("i_image")%>" width="1040" height="300" /></a>
<% if rs("i_box") = "True" then %>
<div u=caption t="*" class="captionOrange" style="position:absolute; left:20px; top: 30px; width:300px; height:30px;">
<% =rs("b_text") %>
</div>
<% end if %>
</div>
<% else %>
<div>
<img src="/images/slider/<%=rs("i_image")%>" width="1040" height="300" />
<% if rs("i_box") = "True" then %>
<div u=caption t="*" class="captionOrange" style="position:absolute; left:20px; top: 30px; width:300px; height:30px;">
<% =rs("b_text") %>
</div>
<% end if %>
</div>
<% end if %>
<% rs.MoveNext %>
<% Loop %>
</div>