Thanks for the explanation. Let's say that currentSlide is 4, totalSlides is 10...
So, cfset nextSlide = (4 MOD 10) + 1> What resutl does the calculation 4 MOD 10 return? It must be 4...but how? What does the MOD do? I read in the maual where it returns the remainder of two numbers, e.g. MOD (integer1, interger2) = remainder interger1, ....don't quite understand that...but what does your statement 4 MOD 10 return? Rick -----Original Message----- From: Dave Francis [mailto:[EMAIL PROTECTED] Sent: Saturday, April 22, 2006 12:57 PM To: CF-Talk Subject: RE: next and previous buttons for slideshow currentSlide is a URL param - needed on first entry and passed in the hrefs therafter. Here's a quick-and-dirty working demo. You'll need to call it "t11.cfm" or change the href's. <cfset totalSlides=10> <cfset nextSlide = (currentSlide MOD totalSlides) + 1> <cfset prevSlide = (currentSlide - 1) + (totalSlides * (currentSlide eq 1))> <cfoutput> NEXT:#nextSlide# CURR:#currentSlide# PREV:#prevSlide# <p style="margin-left:60px;"/> <a href="t11.cfm?currentSlide=#prevSlide#"><PREV</a> <a href="t11.cfm?currentSlide=#nextSlide#">NEXT></a> </cfoutput> -----Original Message----- From: Rick Faircloth [mailto:[EMAIL PROTECTED] Sent: Saturday, April 22, 2006 11:31 AM To: CF-Talk Subject: RE: next and previous buttons for slideshow I've been following this thread because the method of "next / previous" is better than what I currently use...so... I was looking over the code below and I have a few questions... How is the variable "currentSlide" being defined? In assumed previous code? Also, would you put some hard numbers in there for me to view how the functions are working? TIA... Rick -----Original Message----- From: Dave Francis [mailto:[EMAIL PROTECTED] Sent: Saturday, April 22, 2006 10:36 AM To: CF-Talk Subject: RE: next and previous buttons for slideshow This should work: <cfset totalSlides=10> <cfset nextSlide = (currentSlide MOD totalSlides) + 1> <cfset prevSlide = (currentSlide - 1) + (totalSlides * (currentSlide eq 1))> -----Original Message----- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, April 21, 2006 4:45 PM To: CF-Talk Subject: RE: next and previous buttons for slideshow Okay. I just condensed it into a CFC. now I don't have to look at that code every time. <!----------------//------ andy matthews web developer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --------------//---------> -----Original Message----- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, April 21, 2006 3:35 PM To: CF-Talk Subject: RE: next and previous buttons for slideshow Really? Durnit...that sucks...it's sooo clunky. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238476 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

