Page 1 of 1

linkable tab script?

Posted: Thu Jul 06, 2006 6:48 pm
by matt1019
Hi everyone,

I had a question regarding all the "tab" scripts out there on the net.

I have been looking every where for a script like this one:

I would like to know if something like this exists, and if so... what is it called?? (I mean, there has to be a different name than a "Tab Script").


I am looking for a tab script that can be defined in the following way: each tab has an "ID" so if I make a link in index.php like:

Code: Select all

<a href="http://localhost/edit.php?id='2'">This will open the page with "Second Tab" Selected</a>
on edit.php page, the tab panel will be opened with the second tab as the "selected" tab.

Please let me know if I confused anyone :oops:

thanks very much.

-Matt

Posted: Thu Jul 06, 2006 7:06 pm
by dull1554
you could do something like this:

Code: Select all

$tab = $_GET['tab'];
if($tab == 1){
     //output what you want on tab one here
}
if($tab == 2){
     //output what you want on tab two here
}
if($tab == 3){
     //output what you want on tab three here
}
ect.ect.ect.

i hope thats what you ment

and if thats what you want you would like to it like tabbed_page.php?tab=1

Posted: Thu Jul 06, 2006 7:32 pm
by matt1019
Hi Dull,

Thanks for the reply :)

I am looking for something like this:

http://codethat.com/tab/api_ex.html

you select from a dropdown list to set which tab will be active.

So my question is, how can I make a link out of it? (instead of a dropdown list)

(reffering to the script found on the above mentioned site)


-Matt

Posted: Thu Jul 06, 2006 8:11 pm
by matt1019
Nevermind guys, I got it.

Here's the link incase someone like me comes along in the future :lol:

http://codethat.com/tab/url_ex.html?p=0

change p=0 to 0,1,2, or 3

for example:
http://codethat.com/tab/url_ex.html?p=0
http://codethat.com/tab/url_ex.html?p=1
http://codethat.com/tab/url_ex.html?p=2
or
http://codethat.com/tab/url_ex.html?p=3

and you will see what I mean 8)

And these types of tabs are called "Tabs with urlParam"

Anyone knows any other names these are reffered as?

thanks once again, and thanks to Dull for his help also! :)


Regards,

-Matt

Posted: Thu Jul 06, 2006 9:01 pm
by Jenk
You could also do any and all of that in just Javascript..

Posted: Thu Jul 06, 2006 10:08 pm
by matt1019
@Jenk:

know of any particular tab script that does this?

if you do, could you please let me know. :)

Thanks,

-Matt

Posted: Sat Jul 08, 2006 8:40 pm
by matt1019
now is it allright if I bump?

:)

-Matt

Posted: Sat Jul 08, 2006 9:45 pm
by dull1554
Jenk wrote:You could also do any and all of that in just Javascript..
the page that is mentioned above is in javascript, its a nifty simple exampl of client-side interactive material.

Posted: Sun Jul 09, 2006 9:44 am
by matt1019
so you are saying that an example like this (a freeware version) exists?

could you be kind enough and please point me in the right direction :)

-matt

Posted: Sun Jul 09, 2006 12:19 pm
by matthijs
I think you might be looking for http://onlinetools.org/tools/domtabdata/ from Christian Heilmann (also worth checking is his upcoming book http://www.beginningjavascript.com/)

Posted: Sun Jul 09, 2006 6:00 pm
by matt1019
Hi matthijs,

Thanks for your reply and help.

However, this does not seem to perform same functionality as the example I posted.

What I am looking for in a tab script is that I give it a unique url Param (ID) and it opens on that tab.


Quick example:

I have 3 tabs called: "tab1" "tab2" "tab3"

if I make a link to tab 2, the page should open with tab2 as the active tab and have tab 2 contents.

To better understand what my query is, please take a look at the example script from codethat.com that I posted..... This example explains a lot better what I would like than what I could verbally.


-Matt

Posted: Sun Jul 09, 2006 6:09 pm
by matt1019
Hi matthijs,

I am sorry, I am such an ****arrgh!!!****

This is exactly what I was looking for!

The example page http://onlinetools.org/tools/domtabdata/ did not have "index.html" after "http://onlinetools.org/tools/domtabdata/"

Therefore, all the tests I did online such as:

http://onlinetools.org/tools/domtabdata/#how
http://onlinetools.org/tools/domtabdata/#pr
http://onlinetools.org/tools/domtabdata/#style

did nothing but refresh the page (with the same tab as active tab)

HOWEVER,

I went ahead and downloaded the tabscript from the page you provided anyways.... just to play with it.

and opened it up on my computer and voila!

file:///C:/test/domtab/index.html#pr
file:///C:/test/domtab/index.html#dl
...etc etc etc. you get the idea



NOTICE THE DIFFERENCE, my test (on my computer) had index.html file before #pr and #dl parameters


Thanks once again :D

-Matt