Sliding Panels Support Product Page

Not a problem

Error when looping through array

Reported 03 Nov 2013 19:39:34
1
has this problem
03 Nov 2013 19:39:34 Bob Weibler posted:
<CFSET aryThisDirList[2] = "13-326_1.jpg">
<cfloop index="x" from="1" to="#arrayLen(CommercialNumbers)#">

<cfdump var="#aryThisDirList#">
<!--- Now Display The Property Details --->
<CFOUTPUT>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<title>Commercial Property for Sale at </title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

<link rel="stylesheet" type="text/css" href="Styles/dmxSlidingPanels.css" />
<link rel="stylesheet" type="text/css" href="Styles/dmxSlidingPanels/sony_inspired/sony_inspired.css" />
<script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="ScriptLibrary/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="ScriptLibrary/jquery.mousewheel.pack.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxSlidingPanels.js"></script>
</head>
<body text="##000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<h1>This is property #CommercialNumbers[x]#</h1>


<div class="dmxSlidingPanels sony_inspired" style="width:473px;height:350px">
<div id="SlidingPanels#CommercialNumbers[x]#" class="dmxSlidingPanelsView">
<cfloop index="x" from="1" to="#arrayLen(aryThisDirList)#">
<div class="dmxSlidingPanelsPage">
<cfoutput>
<img src="www.rivervalleyhome.com/images/flexmls/photos/#aryThisDirList[x]#" height="314px">
</cfoutput>
</div>
</cfloop>
</div>
<div class="dmxSlidingPanelsHeader">
<div class="dmxSlidingPanelsPrev"><a href="##">Prev</a></div>
<div class="dmxSlidingPanelsNext"><a href="##">Next</a></div>
<div class="dmxSlidingPanelsTitle">Photos of Commercial Property for Sale</div>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
jQuery(document).ready(
function()
{
jQuery("##SlidingPanels#CommercialNumbers[x]#".dmxSlidingPanels(
{"autoplay": true, "autoPlayInterval": 2000, "scrollSpeed": "fast"}
);
}
);
// ]]>
</script>

</body>
</html>
</CFOUTPUT>
</cfloop>

Replies

Replied 04 Nov 2013 11:42:37
04 Nov 2013 11:42:37 Teodor Kuduschiev replied:
Hello,

Please be a little more detailed describing your issue..
Replied 04 Nov 2013 15:27:43
04 Nov 2013 15:27:43 Bob Weibler replied:
I thought the code example would explain pretty well. You should be able to run the code. Sliding Panels is supposed to loop through a 2 item array in this case, but appears to be trying to loop 3 times.
Thanks for your help
Replied 05 Nov 2013 10:43:22
05 Nov 2013 10:43:22 Teodor Kuduschiev replied:
Hello,
Unfortunately we do not support ColdFusion with our extensions.
Replied 05 Nov 2013 16:20:12
05 Nov 2013 16:20:12 Bob Weibler replied:
That's nice to hear.

In case anyone else has this problem, the solution was to loop through a query for the images instead of looping through an array. Now works like I would expect.

Reply to this topic