Skip to content Skip to sidebar Skip to footer

How To Change Class="current" Location In A List?

im sorry for the poor title, i dont know how to explain it. You see i have already created my panel tabs with the help of
    ,
  1. and css. it is working perfectly bu

Solution 1:

Do it manually:

class="<?php echo ($_GET['namelist'] == 'a' ? 'current' : NULL); ?>"
class="<?php echo ($_GET['namelist'] == 'b' ? 'current' : NULL); ?>"
class="<?php echo ($_GET['namelist'] == 'c' ? 'current' : NULL); ?>"
class="<?php echo ($_GET['namelist'] == 'd' ? 'current' : NULL); ?>"

Or do it intelligently:

<?php
foreach (range('a', 'z') as $letter) {
?>
<li class="<?php echo ($_GET['namelist'] == $letter ? 'current' : NULL); ?>"><a href="index.php"><span>#</span></a></li>
<? } ?>

Post a Comment for "How To Change Class="current" Location In A List?"