News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Tabs

Started by Cadish, October 16, 2003, 07:54:56 AM

Previous topic - Next topic

Cadish

Hey,
I want to have a website with tabs (like http://www.robonetics.com). If you're on a specific page, a tab turns red.
This site has to be with frames... So my problem is: how can i make sure that the right tab is red...

Hope you understood...
Cadish

bostasp

The site doesn't look as if it's using frames, if you look in the source ;)

What they have is two sorts of images, say tabon.gif and taboff.gif - being red and grey respectively

It's easily done if you just go through the pages you want to use tabs on and just change the tab img on the page that you currently have open to tabon.gif whereas all the others are taboff.gif

I can think of a possible way to do this with PHP, using if and else, but I'm sure someone more PHP-minded than I am can give a better way do it it...

Tyris

well... basically what bostasp said is right..
at the top or whatever you'd have a series of images... then for the page you're on make it use the red version (so yeah, you'd need two version of each image).
you could combine it into a template system easily enough.. depends what you'd wanna use...

for doing it with frames... hmmm... I like to keep away from frames myself..
but I'd say javascript is the key...
for the relevant image <a href="blah" target="frame" onclick="dothis(page3)">Page 3 Image here</a>
then in the javascript section... the function would need to replace all the images with the imageoff.gif ones.. and then turn the page3 gif on (or rather the gif thats been inputted to the function).
If you dunno much javascript... then you should probably wait till someone better than me comes along, translates what I've said, and writes it for you ;)

I could write it myself... but I'd have to check my reference book and I'm kinda busy :-\

hope it helped.

Cadish

Quote from: bostasp on October 16, 2003, 08:04:12 AM
The site doesn't look as if it's using frames, if you look in the source ;)
Yeah, i know, it was just an example of 'tabs'... ;)

Both of you, thanks, i found a javascript like Tyris said... And it's working...
Thanks alot!

Tyris

no prob, enjoy !! ^_^

bostasp

Tyris is the guy that does the helping :)

Tyris

.... I am... ^_^ cool! I try....
I guess I'm just on a roll this week... makes me wish I'd spent more time studying for specialist maths... I screwed up todays test :(

bostasp

maths, I screwed that up totally in high school  :'(


Advertisement: