CSS code:
<style>. Chose_bonus{font-size:9px;width:400px;Border:2px solid #dddddd;Margin-top:5px;Margin-bottom:5px;padding:9px;background:#ecf3fc;Color:#FFF; }
. Chose_bonus.active{
. Chose_bonus. active{before that, not through, after the way to the above, OK
background:#ecf3fc URL (/ui/common/images/checked-blue.png) no-repeat right Bottom;
Border: 2px solid #467cbd;
}</style>
JS Code:
<script type= "Text/javascript" > $ ('. Chose_bonus '). Click (function() { if ($ (this). Hasclass ("active")) { $ (this). Removeclass ("active"); Else { $ (this). addclass ("active"); } ) </script>
HTML code:
<TRclass= "Bonus"> <thwidth= "+">Optional red Envelopes</th> <TD> <!--{loop $bonuslist [' list '] $key $bonus} - <Divclass= "Chose_bonus"ID= "{$bonus [' id ']}"> <spanstyle= "Font-weight:bold;color: #000;">Red envelopes:</span><bstyle= "color: #fbb450;">Amount {$bonus [' Total_value ']} dollar remaining: {$bonus [' Balance_value ']} meta</b> <BR/> <spanstyle= "Font-weight:bold;color: #000;">Aging:</span><spanstyle= "color: #000; font-weight:bold;">{$bonus [' start_time ']}~{$bonus [' End_time ']}</span><BR/> <spanstyle= "Font-weight:bold;color: #000;">Rules:</span><spanstyle= "color: #000;">{$bonus [' Rule_value ']}</span> </Div> <!--{/loop} - </TD> </TR>
CSS class nesting