alternating class
Hi Ray
On the attached page am trying to show results 3 to a column then on the next row 2 a column then back to 3 and so on
So it should look like this:
<a href="#" class="link-container panelWrapper bgdImage">text</a>
<a href="#" class="link-container panelWrapper bgdImage">text</a>
<a href="#" class="link-container panelWrapper bgdImage">text</a>
<a href="#" class="link-container panelWrapper bgdImage">text</a>
<a href="#" class="link-container panelWrapper bgdImage twoSquare">text</a>
<a href="#" class="link-container panelWrapper bgdImage twoSquare">text</a>
<a href="#" class="link-container panelWrapper bgdImage">text</a>
<a href="#" class="link-container panelWrapper bgdImage">text</a>
<a href="#" class="link-container panelWrapper bgdImage">text</a>
I am using
<?php
$curClass = "bgdImage";
$curCount = 0;
function getSizeClass() {
global $curClass, $curCount;
if ($curCount < 3) {
$curCount++;
} else {
$curCount = 2;
$curClass = ($curClass == "bgdImage")?"bgdImage twoSqaure":"bgdImage";
}
return $curClass;
}
$wa_startindex = 0;
while(!$Portfolio->atEnd()) {
$wa_startindex = $Portfolio->Index;
?>
which is giving me 3 2 and then 2 for each thereafter (instead of 3 2 3 2 3 etc)
How would I modify it to get the desired result?
Cheers
Jamie