While on the subject of accordion plugins, wouldn't it be nice to use John's nextUntil() plugin for the definition-list accordion so that a DT could take multiple DDs? Just a thought.
Karl ___________________ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 27, 2006, at 3:37 AM, Klaus Hartl wrote: > Jörn Zaefferer schrieb: >> Hi Klaus! >> >>> Jörn Zaefferer schrieb: >>>>>> By the way, is there interest to put the accordion into the >>>>>> jQuery >>>>>> repository? >>>>> If you create a subdirectory in SVN/plugins this would be >>>>> really good. >>>>> Since Klaus and I also made an accordion plugin, we might need to >>> change >>>>> that to /plugins/accordion1/ and /plugins/accordion2/. >>>> I'd rather try to create a merge or best breed. I think the event >>> delegation approach is the better one as it uses only a single >>> event handler, but >>> there are other details you might have solved better. If I add my >>> soltion >>> to /plugins/accordion/, you are still free to modify it as you >>> like :-) >>> >>> I agree. Let's put efforts into one plugin...! I'd say our plugin is >>> pretty basic anyway, I'm more dedicated to my tabs and history >>> plugin >>> right now. >>> >>> Franck asked too make it a bit more flexible regarding the HTML >>> structure. If you find that reasonable (I do, because it could >>> also be a >>> h2+p structure), I have done something similiar for the tabs lately, >>> i.e. you set an option too define the HTML structure to rely on. >> >> I wonder if we really need accordion and tabs parallel... Wouldn't >> it be possible to style a definition list to look like tabs? When >> you get down to it, the difference between tabs and accordion is >> just the positioning of the clickable headers. > > Hm, I think they work both a little different. Opening and closing > animations are chained in tabs but happen simultanously in accordion. > > But more important, the underlying structure is quite different as > well. > The tab has one list of links pointing to containers succeding that > list, like link/link/link, container/container/container, while the > accordion is a sequence of link, container, link, container, ... > > >> It's something we should at least check. I like the idea of >> changing a single argument to make my tabs look like an accordion >> and vice-versa. >> >>> Could be something like this: >>> >>> $(...).accordion({ >>> struct: 'h2+p' >>> }); >>> >>> or >>> >>> $(...).accordion({ >>> struct: 'dl>dd+dt' >>> }); >>> >>> One or the other could the default. >>> >>> Hm, I'm beginning to think that "struct" is a better option name >>> then >>> "tabSelector"... >> >> We should try to find a standard that could be used to describe >> this structure (CSS, XPath, SQL, whatever). Or maybe just html, >> eg. struct: "<dl><dt>TITLE</dt><dd>CONTENT</dd></dl>" or struct: >> "<div><h2>TITLE</h2><p>CONTENT</p>". > > The benefit of passing in an XPath/CSS expression is, that it is ready > to use in the script. I don't want to parse the sructure from a given > HTML structure (string) first. I think that is fairly easy in > usage, you > can use CSS or XPath, whatever you are more comfortable with. > > -- Klaus > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/