![]() |
Alternating rows without relying on PHP
Here's a way to alter row colors using vbulletin's template engine without using any outside functions.
At the beginning of your rowbit template place the following code. Code:
<if condition="$bg++"><!-- Row: $bg --></if> Code:
<if condition="$bg%2 == 0">alt2<else />alt1</if> Code:
<if condition="$bg++"><!-- Row: $bg --></if> |
Now THAT is nice. Great work, I can definitely use this in some of my designs.
|
Wow. Thanks.. So much easier than what I had planned... :)
Works very well with modules from vBadvanced, too. I modified the news.php file to be a comments system, and now it looks really nice! Thanks! |
Thanks.
|
Great! Thanks!
|
Why would you not want to rely on the built-in switcher?
|
You can also do it via Javascript if you have a framework like jQuery or Prototype installed:
$("tr: odd").addCLass('altRow'); (remove the space between the : and the o) |
All times are GMT. The time now is 04:52 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|