TIP: spaces remain in values used in {cycle} confuses older browser
| From: | DC | Date: | Tue, 15 Mar 2005 17:43:24 +0000 |
| Subject: | TIP: spaces remain in values used in {cycle} confuses older browser | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12335@lists.php.net to get a copy of this message | ||
This one bit me in the butt... but only on IE mac 5.2 (don't ask!).
When you use {cycle} to apply alternating CSS classes watch out that you don't leave spaces in the values parameter:
{* this implements a table with rollover behaviour *}
{* it would normally be in a section or foreach *}
{* this version breaks in IE 5.2 Mac NOT tested in other IE *}
<TR class="{cycle name="x" values="row_color_1, row_color_2"}"
onmouseover="this.className='rowOver';"
onmouseout="this.className='{cycle name="y" values="row_color_1, row_color_2"}';"
onclick="window.open('?index={$Index_Number[rec]}');"
style="cursor: pointer">
if you leave the space between the values as in:
values="row_color_1, row_color_2"
IE mac 5.2 doesn't like it and doesn't show the row!
To be sure, just remove the space like so:
values="row_color_1,row_color_2"
Cheers,
dan