Demo jQuery Bug #9222
Blinks at the end of the opacity animation.
HTML
<div id="wrapper">
<div id="tickets">
<table id="tickets_table">
<tr>
<th>FOO</th>
<th>BAR</th>
</tr>
<tr><td>foo</td><td>bar</td></tr>
</table>
</div>
<div class="additional_buttons">
<div class="show_more">more</div>
</div>
</div>
CSS
body {
background: none repeat scroll 0 0 #ABB3EF;
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
color: #505362;
padding: 0;
margin: 0;
}
a {
text-decoration: none;
color: #06C;
}
a:hover {
text-decoration: underline;
}
#wrapper {
background: none repeat scroll 0 0 #C7CFF4;
padding: 15px;
margin: 25px;
border: 1px solid #fff;
}
#tickets {
margin: 15px 0 0 0;
}
#tickets_table {
border: 1px solid #fff;
border-collapse: collapse;
}
#tickets_table th {
background-color: #ABB3EF;
font-weight: bold;
color: #000;
}
#tickets_table td, #tickets_table th {
border: 1px solid #fff;
padding: 5px;
}
#tickets_table td {
white-space: wrap;
word-wrap: break-word;
max-width: 350px;
text-align: center;
}
.show_more {
text-align: right;
padding: 5px;
color: #06C;
}
.show_more:hover {
cursor: pointer;
text-decoration: underline;
}
.additional_tickets {
filter: alpha(opacity=0);
-moz-opacity: 0;
-webkit-opacity: 0;
opacity: 0;
}
JavaScript
$(document).ready(function() {
$('.show_more').click( get_next_tickets );
});
// "more" button click-event
function get_next_tickets() {
$('#tickets_table').append('<tr class="additional_tickets"><td>foo</td><td>bar</td></tr>');
$('#tickets_table tr:not(:first-child):even').css('background-color', '#fff');
$('#tickets_table tr:not(:first-child):odd').css('background-color', '#eee');
$('.additional_tickets').animate({opacity: 1}, {duration: 1000});
}