Do not use on any
shared computer
September 5, 2008 08:47pm pdt
 
[x]
Attachment Details

help with javascript function displaying divs (display/hide)...

Zone: JavaScript
Hello experts.

I'm trying to figure out how to make the following work.  

When I click on Tab 1, I'd like the preview contents for tab 1 to be displayed in the right hand table
When I click on Tab 2, I'd like the preview contents for tab 2 to be displayed... and so on
Tab 3..
Tab 4 (This works currently).

Here is the code and attached are the JS files (zipped) I'm trying to use.

(Thanks to the guys at (C) www.dhtmlgoodies.com for the origional scripts.)

Thanks so much for your time.
K
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<link rel="stylesheet" href="/repWebSites/tabs/css/tab-view.css" type="text/css" media="screen">
<script type="text/javascript" src="tab-view.js"></script>
<script type="text/javascript" src="create.js"></script>
</head>
<body>
<table border=0 cellspacing="0" style="margin-top: 0px; margin-left: 0px;" width="600">
  <tr>
    <!--left column-->
    <td valign="top" style="padding-right: 50px; height: 750px;"><div id="dhtmlgoodies_tabView1"> <cfoutput>
          <div class="dhtmlgoodies_aTab">
            <table>
              <tr>
                <td valign="top" style="border: 0px solid ##000000; padding: 10px; font-family: arial; font-size: 11px;" class="formtext2"><strong><span style="font-size: 16px;">Clicking on Tab 1 should display tab1 preview contents in table left></span></strong><br>
                  <!--Enter your name as you would like it to appear on your bio<br> -->
                </td>
              </tr>
            </table>
          </div>
          <!---tab2--->
          <div class="dhtmlgoodies_aTab">
            <table>
              <tr>
                <td valign="top" style="border: 0px solid ##000000; padding: 10px; font-family: arial; font-size: 11px;" class="formtext2"><strong><span style="font-size: 16px;">Clicking on Tab 2 should display tab2 preview contents in left table</span></strong><br>
                  <!--Enter your name as you would like it to appear on your bio<br> -->
                </td>
              </tr>
            </table>
          </div>
          <!---tab3--->
          <div class="dhtmlgoodies_aTab">
            <table>
              <tr>
                <td valign="top" style="border: 0px solid ##000000; padding: 10px; font-family: arial; font-size: 11px;" class="formtext2"><strong><span style="font-size: 16px;">Clicking on Tab 3 should display tab3 preview contents in left table</span></strong><br>
                  <!--Enter your name as you would like it to appear on your bio<br> -->
                </td>
              </tr>
            </table>
          </div>
          <div class="dhtmlgoodies_aTab">
            <table>
              <tr>
                <td valign="top" style="border: 0px solid ##000000; padding: 10px; font-family: arial; font-size: 11px;" class="formtext2"><strong><span style="font-size: 16px;">Clicking on Tab 4 should display tab4 preview contents in left table</span></strong><br>
                  <!--Enter your name as you would like it to appear on your bio<br> -->
                </td>
              </tr>
            </table>
          </div>
        </cfoutput> </div>
      <script type="text/javascript">
		initTabs('dhtmlgoodies_tabView1',Array('Tab1', 'Tab2', 'Tab3', 'Tab4'),0,300,750);
		</script>
    </td>
    <!--right column for preview -->
    <td valign=top rowspan=2><div align="center"><strong>Preview Sample</strong></div>
      <table width="330" style="border: 1px solid #000000; background-color:#ffffff; color: #000000; font-family: arial; display: none; height: 782px; overflow: hidden;" cellspacing=0  id="tab1" name="tab1" cellpadding="5" border=0>
        <!-- Preview Code -->
        <tr valign="top">
          <td id="headerB" style="padding: 5px; height: 400px; background-color: ##000000; color: ##ffffff; overflow: hidden;"> Clicking tab 1 should display tab1 preview contents </td>
        </tr>
      </table>
      <table width="330" style="border: 1px solid #000000; background-color:#ffffff; color: #000000; font-family: arial; display: none; height: 782px; overflow: hidden;" cellspacing=0  id="tab2" name="tab2" cellpadding="5" border=0>
        <!-- Preview Code -->
        <tr valign="top">
          <td id="headerB" style="padding: 5px; height: 400px; background-color: ##000000; color: ##ffffff; overflow: hidden;"> Clicking tab 2 should display tab2 preview contents</td>
        </tr>
      </table>
      <table width="330" style="border: 1px solid #000000; background-color:#ffffff; color: #000000; font-family: arial; display: none; height: 782px; overflow: hidden;" cellspacing=0  id="tab3" name="tab3" cellpadding="5" border=0>
        <!-- Preview Code -->
        <tr valign="top">
          <td id="headerB" style="padding: 5px; height: 400px; background-color: ##000000; color: ##ffffff; overflow: hidden;"> Clicking tab 3 should display tab3 preview contents </td>
        </tr>
      </table>
      <table width="330" style="border: 1px solid #000000; background-color:#ffffff; color: #000000; font-family: arial; display: none; height: 782px; overflow: hidden;" cellspacing=0  id="tab4" name="tab4" cellpadding="5" border=0>
        <!-- Preview Code -->
        <tr valign="top">
          <td id="headerB" style="padding: 5px; height: 400px; background-color: ##000000; color: ##ffffff; overflow: hidden;"> Clicking tab 4 should display tab4 preview contents </td>
        </tr>
      </table></td>
  </tr>
  <form action="createsave.asp" method="post" name="myform" id="myform">
    <tr>
      <td align="left" valign="top" style="padding-top: 40px; height: 200px; font: normal 9px/12px verdana; " colspan=2><strong>Comments / Notes:</strong><br>
        <textarea cols="80" rows="6" name="comments"></textarea>
        <br>
        <!-- Name/Logos -->
        <div align="center">
          <input type="submit" name="save" value="Save Your Changes" style="margin-top: 5px; ">
        </div></td>
    </tr>
  </form>
</table>
</body>
</html>
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Programming
Question Asked By: whaleyk
Solution Provided By: rlively
Participating Experts: 1
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Author Comment by whaleyk
Author Comment by whaleyk:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by whaleyk
Author Comment by whaleyk:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by rlively
Expert Comment by rlively:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by whaleyk
Author Comment by whaleyk:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by rlively
Accepted Solution by rlively:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by whaleyk
Author Comment by whaleyk:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 - Hierarchy / EE_QW_2_20070628