And then an include to a php file or the php in the head that writes content, lets just say text for now, in #content.If #panel1 is clicked then "This is the content in panel 1" is written

is this possible and I hope someone can help me achieve this in PHP. Please let me know if you need any more explanation or if you have any questions, comments, or solutions

Thanks in Advance & Best Regards, Team 1504

team1504
—
2010-12-13T01:07:18Z —
#2

Another thing: The reason why I do not want to just link to separate webpages is that I want to have the content seems to load instantaneously as in the 3rd SPRY demo.

cranial_bore
—
2010-12-13T04:26:18Z —
#3

PHP can't write anything to the page after it's been sent.So, if you go without JS then you will need to do a page reload, which is what you're trying to avoid.

What you can do is have your markup contain different content divs (inside #content), and use JS to swap the visibility of them depending on which tab is clicked.The content for all tabs will be in the markup, but only one will be visible at a time.

If you're already using jQuery on your pages then check out jQuery UI Tabs

or you could write your own JS to handle the clicking/hiding/showing to avoid having to load jQuery UI onto your page.

Zurev
—
2010-12-13T04:42:35Z —
#4

cranial_bore said:

PHP can't write anything to the page after it's been sent.So, if you go without JS then you will need to do a page reload, which is what you're trying to avoid.

What you can do is have your markup contain different content divs (inside #content), and use JS to swap the visibility of them depending on which tab is clicked.The content for all tabs will be in the markup, but only one will be visible at a time.

If you're already using jQuery on your pages then check out jQuery UI Tabs

or you could write your own JS to handle the clicking/hiding/showing to avoid having to load jQuery UI onto your page.

However an ajax script (or ajax through jQuery) wouldn't be too difficult to do, and would avoid loading every single page into the initial home page at first.

team1504
—
2010-12-13T19:24:06Z —
#5

I forgot that without javascript or a library based off of javascript, php can not update the page after it is loaded. Thank you for the help. an thank you cranial-bore for reminding me about jQuery UI. I have looked at it since it first came out.And it should be faster because I am already linking the jQuery main library instead of linking a whole separate library, such as the SPRY one.

cranial_bore
—
2010-12-13T23:34:15Z —
#6

Well (although I suggested it) jQuery UI can be quite weighty. Bigger than jQuery its self.If you only need simple tabs use this example. The extra JS is only 738 bytes.

You haven't included jQuery in your page. I didn't, because you said you already had it. Also script should load at the bottom of the <body> section, not in the header.

team1504
—
2010-12-14T15:22:45Z —
#10

stupid mistake sorry.I was just testing the code alone first. Yes it works! Thank you. I play around with this and jQuery UI and see how fast-loading and small I can get the tabs to be and let you know.