View Full Version : another DD Tab modification

07-14-2005, 05:01 AM
here is the script I am using http://dynamicdrive.com/dynamicindex1/ddtabmenu2.htm

I wasn't sure if this would go unnoticed in the topic I already made, but since it is a whole new question, I thought it would better of in its own topic.

I am working on a layout for a game site and what I am thinking of doing is having a DD Tab Menu for each game. Each of the tabs pertain to a different aspect of the game. You click on the "preview" tab to see a preview for an upcoming game, and later on, once the game is released, you will be able to click on the "review" tab and read our thoughts on the game.

I have this page set up and it works perfectly, but there is one last thing that I am wondering if it can be done. Lets say that the visitor is looking at the list of our game reviews. They see a game they are interested and click on it. Is it possible that when that particular game page loads, the "review" tab is already selected instead of the default tab that was set in the javascript code? At the same time, if the user looked through our list of previews and clicked on the same game, the "preview" tab would be the one selected.

I am thinking that there is a way to set the href tag so that it changes the default value of the javascript code. So, lets say that the default tab in the javascript is "sc1" and that the tab you click on to read the review of a game is "sc2." Well, if you go to the list of game reviews and click on a game, clicking on that link would change the default setting of the javascript to be "sc2," so that when page loads, the user is under the review tab. This would be a one time only thing of course. By the time the user navigates off to another page, the default tab in the javascript code would still be "sc1"

07-14-2005, 11:42 PM
This topic sank rather quick, not sure if many people got a chance to see it. I tried to explain myself as clearly as possible, but if I lost/confused anyone, let me know.

07-18-2005, 06:15 AM
don't want to keep on bugging, but does anyone know how to go about this? :(

07-18-2005, 09:36 AM
I read this thread each time you posted to it, sometimes more than once. I am having a little trouble wrapping my head around it in the abstract. How about posting a link to what you say you have so far? That way I won't have to create a simulation from scratch, just hoping I've got it like what you are talking about. Ala:


It would also be beneficial if you could lay out a numbered flow outline of what you want:

1 ) User does this

2 ) These things happen

3 ) User does that

4 ) These other things happen

If the events are related or just:

1 ) User does this

2 ) These things happen

1 ) User does that

2 ) These other things happen

If the events are unrelated to oneanother.

07-18-2005, 08:51 PM
Ok, here is the basic outline. This is our current web-site (we are undergoing a major redesign right now, so it will much more professional in the future :D )


here you see a list of our game reviews for a the Nintendo Gamecube console. When the user clicks on any of these links, they are taken into the review of that particular game. Now, what we are doing in this new layout is condensing everything into one page using the DD Tabs like you see below. Notice that I am using geocities to show you this, since I don't have access to our real server.


As you can see, this will be the new layout for each and every game in our site. The game's preview, review, etc is all in the same HTML file and can quickly be accessed by switching between tabs. This layout is great, but here is the one issue that we are trying to fix:

When a visitor clicks on "reviews" at the top of the site and accesses our list of game reviews, as soon as they click on the game they want to see a review of, the game page will load with the default tab selected. In this case, the dafault tab is the one titled "main." Is it possible to modify this script so that when someone clicks on a link to the game's review, the tab titled "review" in the game page is the one that loads at the beginning instead of the tab titled "main?" At the same time, if the visitor browses through the list of game previews, and clicks on the preview of that same game, the tab titled "preview" will be the one that is selected when the game page loads. With that done, here is the breakdown

case 1

1. User looks through our list of game reviews and clicks on "game x"
2. The game page for "game x" loads with the "review" tab already selected

case 2

1. User looks through our list of game previews and clicks on the same game (game x)
2. the game page for "game x" loads with the "preview" tab already selected

case 3

1. User looks through our list of game media and clicks on the same game (game x)
2. The game page for "game x" loads with the "media" tab already selected

Here is an image that fully illustrates the proccess explained above

Thats basically what we are trying to do. We want different tabs to be already selected depending on where the user is coming from. Again, if there is anything that confuses you, let me know so I can clarify it further.

07-19-2005, 04:07 AM
A friend of mine contacted a web programmer he knows and had him comment on my problem. He outlines what I should do, but I don't have a clue how to go about it. Most likely you do, John.

"He simply needs to create a session variable which stores the value of the current active section and then he needs to pass it through his JavaScript code. This can be done with any server side processing language such as ASP, PHP, ColdFusion, or a number of other programming languages. Once this value is stored it would be easy to achieve what he is trying to accomplish."

07-19-2005, 08:27 AM
Ungh! I don't do those other languages. If it cannot be done with javascript, I'm probably not the one for the job. If you have a variable handy from one of those languages (especially if it is passed on the location bar) I can perhaps retrieve and use it. I've seen many things done with javascript that others thought had to be done server side though. In any case, this looks to be quite a project. I'm not sure when I will have the time to tackle it.

07-19-2005, 05:53 PM
To tell you the truth, I don't want to get involved with server-side coding unless there is no other way around it. Here is what I am thinking though, hopefully it is possible to do through javascript.


As you know, you can go into the javascript and and set the default tab to be whatever you want it to be. In the link above, the default tab to be selected when the page loads is "sc1." Now, here is what I was thinking, is it possible to change this one part of the javascript? For example, lets say the user is currently looking at the list of game reviews and clicks on the game they want. Well, could the "href" tag be modified so that when the user clicks on that link the "onclick" commands activates and tells the javascript to have a particular tab pre-selected when the game page loads?

So, here is the outline. For this example lets say the review of "game x" is located in the tab id "sc2"

1. User accesses the list of game reviews and clicks on "game x"
2. the "onclick" command is then innitiated and tells the javascript to have the tab "sc2" pre-selected when the page loads.

07-19-2005, 09:10 PM
John, here is much easier set up. Look at the image below. clicking "link 1" will make the page load with "tab 1" pre-selected, clicking "link 2" will make the page load with "tab 2" pre-selected, and so on. Is this possible to do through Javascript?


07-20-2005, 02:28 PM
Have a look at this thread and see if we are talking about the same thing, I thought it was you at first.


07-20-2005, 05:27 PM
JOHN! YOU ROCK! sweetness! I finally got this to work perfectly!!! YEAH!!! thanks so much for going through all this, I really appreciate it. I'll be sure to send you PM with the link to our new site once it opens. :D