[jQuery] Re: jquery.tabs - is it possible?
MrNase wrote: I am playing around with jquery.tabs but I am having a major problem. From the examples I see that it needs a code like this to work: div id=container-1 ul lia href=#fragment-1spanOne/span/a/li lia href=#fragment-2spanTwo/span/a/li lia href=#fragment-3spanTabs are flexible again/span/a/li /ul div id=fragment-11/div div id=fragment-22/div div id=fragment-33/div /div But my code currently looks like this: div id=content div id=fragment-11/div div id=fragment-22/div div id=fragment-33/div /div div id=sidebar ul lia href=#fragment-1One/a/li lia href=#fragment-2Two/a/li lia href=#fragment-3Tabs are flexible again/a/ li /ul /div How can I make it work without changing my code? That's impossible without changing the code, I'm sorry. -- Klaus
[jQuery] Re: jquery.tabs - is it possible?
The short unhelpful answers are (a) you can't or (b) you need to hack the tabs plugin. Currently the plugin searches for the ul and each tab's div in the same container. It is of course possible to change this behaviour, but without delving into the depths of the plugin I couldn't advise you on how to go about it... Given that your current layout is for links at the side of the page, how does that fit in with the tabbed view idea? Are you planning to keep the sidebar as a fallback mechanism? If so, use jQuery to move the ul from its current location to the content div prior to doing $(#content).tabs() would work well I expect. Hope that helps anyway, --rob On 5/25/07, MrNase [EMAIL PROTECTED] wrote: I am playing around with jquery.tabs but I am having a major problem. From the examples I see that it needs a code like this to work: div id=container-1 ul lia href=#fragment-1spanOne/span/a/li lia href=#fragment-2spanTwo/span/a/li lia href=#fragment-3spanTabs are flexible again/span/a/li /ul div id=fragment-11/div div id=fragment-22/div div id=fragment-33/div /div But my code currently looks like this: div id=content div id=fragment-11/div div id=fragment-22/div div id=fragment-33/div /div div id=sidebar ul lia href=#fragment-1One/a/li lia href=#fragment-2Two/a/li lia href=#fragment-3Tabs are flexible again/a/ li /ul /div How can I make it work without changing my code? -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: jquery.tabs - is it possible?
Klaus, Since the div's that are being toggle all have IDs that means they are unique, so why not search the document namespace instead of just the containing div? ~Sean
[jQuery] Re: jquery.tabs - is it possible?
Sean Catchpole wrote: Klaus, Since the div's that are being toggle all have IDs that means they are unique, so why not search the document namespace instead of just the containing div? Sean, of course this is easily doable. When I first started the tabs I created an overall container because the list and the tabs containers are semantically one unit to me, thus that should be expressed via the HTML as well by a div wrapping up both building blocks (That is also the reason why I always chose an id like container as being non-presentational as opposed to tabs, which is a completely presentational id). I will consider that for Tabs 3. The only thing whats needed is actually just the list, I know. From there it's easy to get to the containers. Requirement in this case was unfortunatly that the HTML cannot be changed. With the recently added increase in flexibility it could already work out with attaching a few classes. You would just need to attach the relevant classes to the building blocks and then use *some* outer container as starting point. If the plugin doesn't find elements by the default structure it tries to find elements by class, so in the given example, assuming these elements are nested in the body: body div id=content div id=fragment-1 class=tabs-container1/div div id=fragment-2 class=tabs-container2/div div id=fragment-3 class=tabs-container3/div /div div id=sidebar ul class=tabs-nav lia href=#fragment-1One/a/li lia href=#fragment-2Two/a/li lia href=#fragment-3Tabs are flexible again/a/li /ul /div /body Initialization like that should work: $('body').tabs(); -- Klaus
[jQuery] Re: jquery.tabs - is it possible?
Klaus, thanks for your reply. :-) I don't get it to work so I'll write my own small plugin. :-( ---dominik