Really?

Durnit...that sucks...it's sooo clunky.

<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Ben Nadel [mailto:[EMAIL PROTECTED]
Sent: Friday, April 21, 2006 3:31 PM
To: CF-Talk
Subject: RE: next and previous buttons for slideshow


That's pretty condensed to me.

You pretty much have to check the three cases...

........................
Ben Nadel
www.bennadel.com
-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Friday, April 21, 2006 4:25 PM
To: CF-Talk
Subject: next and previous buttons for slideshow

I'm rewriting my slideshow code in preperation for releasing it publicly.

I wondered if some of you might have input as to how to rewrite this snippet
a little more elegantly:

<cfset VARIABLES.totalslides = 10>
<cfset URL.slide = 4>

<cfif URL.slide EQ 1>
        <cfset VARIABLES.prev = VARIABLES.totalslides>
        <cfset VARIABLES.next = 2>
<cfelseif slide EQ VARIABLES.totalslides>
        <cfset VARIABLES.prev = VARIABLES.totalslides - 1>
        <cfset VARIABLES.next = 1>
<cfelse>
        <cfset VARIABLES.prev = slide - 1>
        <cfset VARIABLES.next = slide + 1>
</cfif>

I feel as if I should be able to condense this quite a bit, but I'm not sure
how to go about it. The frist two variables are being set dynamically by the
way.

<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238427
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

Reply via email to