[thelist] smarty tip
Matt Warden
mwarden at gmail.com
Thu Mar 17 14:28:26 CST 2005
This was posted by 'dan' on the Smarty list. Thought it might be
helpful. Reposted with permission.
<tip author="dan" type="Smarty">
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"
</tip>
--
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com
This email proudly and graciously contributes to entropy.
More information about the thelist
mailing list