Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9289811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:16:10+00:00 2026-06-18T20:16:10+00:00

I have some queries in this code. This is the menu bar JavaScript in

  • 0

I have some queries in this code. This is the menu bar JavaScript in this it has many tab. When I run this code it automatically click in Second TAB instead of First TAB.

JAVASCRIPT CODE.

   var dolphintabs={subcontainers:[], last_accessed_tab:null,

    revealsubmenu:function(curtabref){
    this.hideallsubs()
    if (this.last_accessed_tab!=null)
        this.last_accessed_tab.className=""
    if (curtabref.getAttribute("rel")) //If there's a sub menu defined for this tab     item, show it
    document.getElementById(curtabref.getAttribute("rel")).style.display="block"
    curtabref.className="current"
    this.last_accessed_tab=curtabref
    },

    hideallsubs:function(){
    for (var i=0; i<this.subcontainers.length; i++)
    document.getElementById(this.subcontainers[i]).style.display="none"
    },

    init:function(menuId, selectedIndex){
    var tabItems=document.getElementById(menuId).getElementsByTagName("a")
    for (var i=0; i<tabItems.length; i++){
    if (tabItems[i].getAttribute("rel"))
        this.subcontainers[this.subcontainers.length]=tabItems[i].getAttribute("rel") //store id of     submenu div of tab menu item
    if (i==selectedIndex){ //if this tab item should be selected by default
    tabItems[i].className="current"
    this.revealsubmenu(tabItems[i])
        }
    tabItems[i].onclick=function(){
    dolphintabs.revealsubmenu(this)
    }
    } //END FOR LOOP
    }
    }

HTML Code :

<head>
<title>Cut & Paste Dolphin Tabs Menu</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="dolphin.js">
</script>
</head>

<body>

<div id="dolphincontainer">
<div id="dolphinnav">
<ul>
<li><a href="http://www.javascriptkit.com"><span>Home</span></a></li>
<li><a href="http://www.javascriptkit.com" rel="joey"><span>Joey</span></a></li>
<li><a href="http://www.javascriptkit.com" rel="suzy"><span>Suzy</span></a></li>
<li><a href="http://www.javascriptkit.com" rel="george"><span >George</span></a></li>
<li><a href="http://www.javascriptkit.com"><span>Contact Us</span></a></li>
</ul>
</div>
<div id="dolphin_inner">
<div id="joey" class="innercontent">
Joey's statue of a white dog was originally given to Jennifer Aniston as a good luck present from her best friend.
</div>

<div id="suzy" class="innercontent">
During this period, then-locally famous Suzy Waud anchored evening broadcasting.
</div>

<div id="george" class="innercontent">
George Louis Costanza is a fictional character on the United States based television sitcom Seinfeld (1989–1998).
</div>

<!-- End Sub Menus container -->
</div>

</div>

<script type="text/javascript">

</script>
    </body>
    </html>

CSS Code :

#dolphincontainer{position:relative;border-bottom: 2px solid navy;     color:#E0E0E0;background:#143D55;
width:100%;font-family:Helvetica,Arial,Verdana,sans-serif;}
#dolphinnav{position:relative;height:33px;font-size:12px;text-transform:uppercase;font-           weight:bold;background:#fff url(images/dolphin_bg.gif) repeat-x bottom left;padding:0 0 0 20px;}
#dolphinnav ul{margin:0;padding:0;list-style-type:none;width:auto;float:left;}
#dolphinnav ul li{display:block;float:left;margin:0 1px;}
#dolphinnav ul li a{display:block;float:left;color:#EAF3F8;text- decoration:none;padding:0 0 0 20px;height:33px;}
#dolphinnav ul li a span{padding:12px 20px 0 0;height:21px;float:left;}
#dolphinnav ul li a:hover{color:#fff;background:transparent url(images/dolphin_bg-OVER.gif) repeat-x bottom left;}
#dolphinnav ul li a:hover span{display:block;width:auto;cursor:pointer;}
#dolphinnav ul li a.current,#dolphinnav ul li a.current:hover{color:#fff;background:#1D6893 url(images/dolphin_left-ON.gif) no-repeat top left;line-height:275%;}
#dolphinnav ul li a.current span{display:block;padding:0 20px 0 0;width:auto;background:#1D6893 url(images/dolphin_right-ON.gif) no-repeat top right;height:33px;}

#dolphin_inner{color: white; padding: 5px; font-size: 80%; height: 1em}

#dolphin_inner a:link, #dolphin_inner a:visited, #dolphin_inner a:active{color: white}
#dolphin_inner a:hover{color: yellow}

.innercontent{display: none;}

For Sample Please See the below Link. Click Here to View the Sample of it http://www.javascriptkit.com/script/script2/tabset/index.shtml

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T20:16:11+00:00Added an answer on June 18, 2026 at 8:16 pm

    Add rel attribute to your <a> tag
    Home

    Hope this helps!

    UPDATED
    In your HTML code update the below call

    dolphintabs.init("dolphinnav", 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Sql queries inside VBA code, this is an example of a
I have some code in a javascript file that needs to send queries back
I have some xml documents I need to run queries on. I've created some
I have to run some mysql update queries and they take quite a long
I have seen prefix N in some insert T-SQL queries. Many people have used
I have some queries being run in a java program that makes use of
Ok so I have to run some queries in access 07 then compact and
Strange Issue. I have the some code that queries a database and prases the
I have some code that builds SQL queries to perform a lenient, catch-all kind
I have some code that when called calls a webservice, queries a database and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.