[jQuery] Re: Toggle element based on value

2007-07-05 Thread DamianD
Thanks, Here is the code I used: $("a.emailitem").click(function(){ var i = $(this).attr("id"); var y = i.split("|"); var url = "/emailstory/index/" + y[1]; $("div.newsitememail:eq(" + y[0] + ")").load(url); $("div.newsitememail:eq(" + y[0] + ")

[jQuery] Re: Toggle element based on value

2007-07-02 Thread Karl Swedberg
Hi Damian, I think you're on the right track, too, but it looks like you might be working too hard to find the right div to toggle. The trick is to determine where the "div.newsitememail" element is in relation to the clicked "a.emailitem" in the DOM. For example, if each newsitememail is

[jQuery] Re: Toggle element based on value

2007-07-01 Thread DamianD
I think i'm on the right track, my code below works...sort of: $("a.emailitem").click(function(){ $("div.newsitememail:nth(0)").toggle(); } ); Though, obviously, no mater which "a.emailitem" is clicked - the first newsitememail div is toggled...not exactly what is needed. I tr