Ahh, I forgot to test that. It's fixed now. refresh. Glen
On 10/22/07, Rick Faircloth <[EMAIL PROTECTED]> wrote: > > Wish I could, Glen. > > > > This is a secure app, closed to the public… sorry. > > I'll be creating some public calendars, etc., with this > > technique later on, but haven't, yet. > > > > Anything you'd like for me to try? > > > > Rick > > > > > > > > *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Glen Lipka > *Sent:* Monday, October 22, 2007 3:33 PM > *To:* jquery-en@googlegroups.com > *Subject:* [jQuery] Re: How would I modify this code to... > > > > Could you post a URL of the page? > Easier to debug that way. > > Glen > > On 10/22/07, *Rick Faircloth* < [EMAIL PROTECTED]> wrote: > > Just one issue, Glen. > > > > With this code (changed to match my HTML… I'll rewrite that later), > > everything works perfectly, except that if I click on the same table > > (the 'table.clickme'), the row closes, then opens and closes again. > > > > $(document).ready(function(){ > > > > > $('div.calendar').find('div.details').hide().end(); > > > > > $('table.clickme').click(function(){ > > > > $('div.details:visible' > ).slideUp(); > > $(this).next("div.details > ").slideToggle(); > > > > }); > > > > > > }); > > > > How do I prevent that? Do I need some kind of "if" statement to > > check the open/closed state of the "div.details"? > > > > "if div.details is open, then close, > > else open…" ??? > > > > Rick > > > > > > > > *From:* jquery-en@googlegroups.com [mailto: [EMAIL PROTECTED] *On > Behalf Of *Glen Lipka > *Sent:* Monday, October 22, 2007 12:22 PM > *To:* jquery-en@googlegroups.com > *Subject:* [jQuery] Re: How would I modify this code to... > > > > I whipped up a demo. > http://www.commadot.com/jquery/faq.php > > Is this the kind of thing you were looking for? > > Glen > > On 10/22/07, *Rick Faircloth* < [EMAIL PROTECTED]> wrote: > > …cause any open details div to close when another details div opens? > > $(document).ready(function() { > > $('div.calendar').find('div.details').hide().end().find('table.clickme').click(function() > { > > var answer = $(this).next(); > > if (answer.is(':visible')) { > > answer.slideUp(); > > } else { > > answer.slideDown(); > > } > > }); > > }); > > This has been working great to open a div with details when > > a table is clicked (yes, I'm using a complete table for the info because > > it animates more smoothly than a row). > > However, now I'd like for an open div to slide up when another > > table is clicked is slide down a new div. In other words, have only > > one open details div at a time. > > Perhaps I should add a class to a details div when it slides down (opens) > called "open " > > and then change the class to "closed" when another table is clicked and > then cause > > any details div's with the newly assigned "closed" class to slide up > (close)? > > If so, can this new approach be integrated into the code above or does the > > code need to be rewritten? > > Suggestions? > > Rick > > > > >