Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: another DD Tab modification

  1. #1
    Join Date
    Jul 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Changing the default tab when "onclick" is executed

    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"
    Last edited by EliteSeraphim; 07-14-2005 at 11:45 PM.

  2. #2
    Join Date
    Jul 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  3. #3
    Join Date
    Jul 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    don't want to keep on bugging, but does anyone know how to go about this?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    PLEASE: Include the URL to your problematic webpage that you want help with.

    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.
    Last edited by jscheuer1; 07-18-2005 at 09:39 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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 )

    http://www.projectcoe.com/Nin_Reviews/reviews_gcn.html

    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.

    http://www.geocities.com/eliteseraphim/wpmain2.html

    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
    http://img.photobucket.com/albums/v6...oth/branch.jpg

    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.
    Last edited by EliteSeraphim; 07-18-2005 at 09:11 PM.

  6. #6
    Join Date
    Jul 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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."

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Jul 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

    http://dynamicdrive.com/dynamicindex1/ddtabmenu2.htm

    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.
    Last edited by EliteSeraphim; 07-19-2005 at 05:56 PM.

  9. #9
    Join Date
    Jul 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

    http://img.photobucket.com/albums/v6...th/branch2.jpg
    Last edited by EliteSeraphim; 07-20-2005 at 04:46 AM.

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Have a look at this thread and see if we are talking about the same thing, I thought it was you at first.

    http://www.dynamicdrive.com/forums/s...ead.php?t=3917
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •