Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Putting recordsets in a DHTML Scroller
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

shaneb
Junior Member

USA
319 Posts

Posted - 03 March 2001 :  15:24:40  Show Profile  Send shaneb a Yahoo! Message
I'm trying to put recordsets in a DHTML scroller script. I think I have to change the whole SQL code in order to get this to work. The problem is I want to display 5 recordsets at a time in the scroller. Once the scroller goes through 20 recordsets it returns back to the first 5. I can get it to work with one record set at a time but as I said I want it to work 5 at a time. Can use some help. I got the scroller from DynamicDrive.com "Mikes Scroller"

Here is what I have so far. First take a look at the scroller at http://www.brass-in.com/test_inc_jobs.asp

Now here is what I have as far as code.

<%
Server.ScriptTimeout = 120
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.MaxRecords = 20
' q = "SELECT * FROM jobs ORDER BY dateposted desc"
q = "SELECT TOP 20 * FROM jobs ORDER BY dateposted desc"
rs.Open q, Application("Connection_String")
x = 0
if NOT rs.EOF then
while NOT rs.EOF
if x < 20 then
x = x + 1
recnum = rs("number").value
end if
rs.MoveNext
wend
rs.Close
rs.Open q, Application("Connection_String")
end if

%>
<html>
<head>
<title>Job Search - Matching Jobs</title>
</head>
<body>
<script language="JavaScript" src="dhtmllib.js"></script>
<script language="JavaScript" src="scroller.js"></script>
<script language="JavaScript">
/*
Mike's DHTML scroller (By Mike Hall @ Brainjar.com)
Permission granted to Dynamicdrive.com to include script in archive
For this and 100's more DHTML scripts, visit http://dynamicdrive.com
*/


/*
Line 41 sets the properties of the table. Scroller(x layer position, y layer position, width, height, border, padding) *
Line 46 is how you add items to the scroller. Since I am using ASP I only need one line.
*/
var myScroller1 = new Scroller(0, 0, 180, 280, 1, 2);
myScroller1.setColors("#000066", "#EFEFEF", "#EFEFEF");
myScroller1.setFont("Verdana,Arial,Helvetica", 1);
myScroller1.setPause(4000)
myScroller1.setSpeed(100)
myScroller1.addItem("<%For n = 0 to x-1 %><%=n+1 &". "%></B><a href=/aspemployee/matchingjobs.asp?number=<%=rs("number")&">"& rs("title")&"</a></B><BR>" & "    " & rs("company")&"<BR>" & "    " & rs("city")&", " & rs("state")&"<BR>" &"    " & rs("dateposted")&"<BR>" & rs.MoveNext%><%next%><%rs.Close%><%set rs = nothing %>");
function runmikescroll()
{
var layer;
var mikex, mikey;
// Locate placeholder layer so we can use it to position the scrollers.
layer = getLayer("placeholder");
mikex = getPageLeft(layer);
mikey = getPageTop(layer);
// Create the first scroller and position it.
myScroller1.create();
myScroller1.hide();
myScroller1.moveTo(mikex, mikey);
myScroller1.setzIndex(100);
myScroller1.show();
}
window.onload=runmikescroll
</script>
<div id="placeholder" style="position:relative; width:180px; height:280px;">
</div>

</body>
</html>


'Surround your mind and you shall see a great future ahead'

Shane B.

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 04 March 2001 :  15:43:46  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
What's not working. It seems to scroll for me in IE5

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

shaneb
Junior Member

USA
319 Posts

Posted - 04 March 2001 :  16:05:58  Show Profile  Send shaneb a Yahoo! Message
quote:

What's not working. It seems to scroll for me in IE5

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead



You'll notice that it only scrolls the first 5 and then rescrolls the same 5. I want it to scroll the first 5, then the next 5, then the next 5 and then the last five before it starts all over again. I think the SQL statement I am using is not correctly set up to do this because it is getting the top 20, but when I put the query into the scroller the scroller can't seem to get but the first 5.

'Surround your mind and you shall see a great future ahead'

Shane B.

Go to Top of Page

shaneb
Junior Member

USA
319 Posts

Posted - 05 March 2001 :  02:25:56  Show Profile  Send shaneb a Yahoo! Message
Never mind. I got it working. If anybody's interested you can see it on my home page. http://www.brass-in.com



'Surround your mind and you shall see a great future ahead'

Shane B.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07