[jQuery] Re: Need help 're-stripping' a table
Scott Trudeau wrote: Heh. IE has me so trained not to use fancy css selectors I forgot about :even. I just wrote the same thing like: Just for the record, the :even pseudo class is not CSS, it is a jQuery extension. With CSS 3, it looks like: tr:nth-child(even) --Klaus
[jQuery] Re: Need help 're-stripping' a table
Heh. IE has me so trained not to use fancy css selectors I forgot about :even. I just wrote the same thing like: $("tr").each(function(i){ if(i % 2 == 0) $(this).addClass("on"); else $(this).removeClass("on"); }); On 8/6/07, cliff <[EMAIL PROTECTED]> wrote: > > > Actually, I figured it out. > > $('#pageElement') should be $('#'+pageElement) > > This is most of the function > $('#'+pageElement).remove(); > stripeMe(); > > function stripeMe() { > $(".stripeMe tr").removeClass("alt"); > $(".stripeMe tr:even").addClass("alt"); > rowOver(); > } > > function rowOver() { > $(".stripeMe tr").mouseover(function() {$ > (this).addClass("over");}).mouseout(function() {$ > (this).removeClass("over");}); > } > > On Aug 6, 5:44 pm, "Benjamin Sterling" > <[EMAIL PROTECTED]> wrote: > > Cliff, > > I must have missed something, but what is stripeMe();? Do you have a > demo > > page to look at? > > > > On 8/6/07, cliff <[EMAIL PROTECTED]> wrote: > > > > > > > > > I am trying to remove a row from a table and then re-strip it as > > > follows: > > > > > $('#rowid').remove(); > > > stripeMe(); > > > > > But I can't get this to work. Either re-striping isn't working or the > > > row isn't being completely remove. > > > > > Help! > > > > -- > > Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com > > -- .|.. Scott Trudeau scott.trudeau AT gmail DOT com http://sstrudeau.com/ AIM: sodthestreets
[jQuery] Re: Need help 're-stripping' a table
Actually, I figured it out. $('#pageElement') should be $('#'+pageElement) This is most of the function $('#'+pageElement).remove(); stripeMe(); function stripeMe() { $(".stripeMe tr").removeClass("alt"); $(".stripeMe tr:even").addClass("alt"); rowOver(); } function rowOver() { $(".stripeMe tr").mouseover(function() {$ (this).addClass("over");}).mouseout(function() {$ (this).removeClass("over");}); } On Aug 6, 5:44 pm, "Benjamin Sterling" <[EMAIL PROTECTED]> wrote: > Cliff, > I must have missed something, but what is stripeMe();? Do you have a demo > page to look at? > > On 8/6/07, cliff <[EMAIL PROTECTED]> wrote: > > > > > I am trying to remove a row from a table and then re-strip it as > > follows: > > > $('#rowid').remove(); > > stripeMe(); > > > But I can't get this to work. Either re-striping isn't working or the > > row isn't being completely remove. > > > Help! > > -- > Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com
[jQuery] Re: Need help 're-stripping' a table
Cliff, I must have missed something, but what is stripeMe();? Do you have a demo page to look at? On 8/6/07, cliff <[EMAIL PROTECTED]> wrote: > > > I am trying to remove a row from a table and then re-strip it as > follows: > > $('#rowid').remove(); > stripeMe(); > > But I can't get this to work. Either re-striping isn't working or the > row isn't being completely remove. > > Help! > > -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com