It'll be more efficient if you store the elements you're going to
manipulate into a variable. Also, since you're doing the same thing
twice, you could make it into a function.
e.g.
$(document).ready(function()
{
var getTrs = $('tbody.bevker tr');
It'll be more efficient if you store the elements you're going to
manipulate into a variable. Also, since you're doing the same thing
twice, you could make it into a function.
e.g.
$(document).ready(function()
{
var getTrs = $('tbody.bevker tr');
Jesus Christ?!
Thanks for all the variations...AND explanations!
Frank
On 10/18/07, Michael Geary <[EMAIL PROTECTED]> wrote:
>
>
> First, combine duplicate code into a single function:
>
> $(document).ready(function() {
> zebra();
> $('th').click( zebra );
> });
>
> function zebra() {
>
P.S.
Here is what my final script looks like.
After the below function example, I started to get lost in obscurity.
$(document).ready(function()
{
zebra();
$('th').click( zebra );
function zebra()
{
$('tbody.bevker tr:odd').removeClass().addClass('row0 od
First, combine duplicate code into a single function:
$(document).ready(function() {
zebra();
$('th').click( zebra );
});
function zebra() {
$('tbody.bevker tr:odd').removeClass();
$('tbody.bevker tr:even').removeClass();
$('tbody.bevker tr:odd').addClass('row0 odd');
$('
5 matches
Mail list logo