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 8021339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:57:01+00:00 2026-06-04T21:57:01+00:00

The below tabs works fine with external js file.How to add the links so

  • 0

The below tabs works fine with external js file.How to add the links so that when the user click the link http://www.ll.com/#comments ,he will see the comments..tab
http://www.dynamicdrive.com/dynamicindex17/tabcontent/tabcontent.js

<ul id="countrytabs" class="shadetabs">
<li><a href="#movies" rel="tutorial" class="selected">Tutorial</a></li>
<li><a href="#Comments" rel="comments">Comments</a></li>  
</ul>
<div class="contentbox">
<div id="movies" class="tabcontent">
Download movies here
</div>
<div id="comments" class="tabcontent">
</div>


<script type="text/javascript">
var countries=new ddtabcontent("countrytabs")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
  • 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-04T21:57:04+00:00Added an answer on June 4, 2026 at 9:57 pm

    Try this, after countries.init():

    var tagIndex = window.location.toString().indexOf('#');
    if (tagIndex >= 0)
        countries.expandit(window.location.toString().substring(tagIndex).toLowerCase());
    

    EDIT: You had a few problems in the example code you provided (You did not wait for the document onload event. You did not follow the naming-conventions of the A links as on the ddtabcontent documentation site, …)

    I have created this example to test its functionality:

    <html>
        <head>
            <script type="text/javascript" src="tabcontent.js"></script>
            <script type="text/javascript">
                 function onload()
                 { 
                    var countries = new ddtabcontent("countrytabs");
                    countries.setpersist(true);
                    countries.setselectedClassTarget("link");
                    countries.init();
                    var url = window.location.toString();
                    var tagIndex = url.indexOf('#');
                    if (tagIndex >= 0)
                        countries.expandit(url.substring(tagIndex).toLowerCase());
                }
            </script>
            <style type="text/css">
                div.tabcontent
                {
                    display: none;
                }
            </style>
        </head>
        <body onload="onload()">
            <ul id="countrytabs" class="shadetabs"> 
                <li><a href="#movies" id="#movies" rel="movies" class="selected">Movies</a></li> 
                <li><a href="#comments" id="#comments" rel="comments">Comments</a></li>   
            </ul> 
            <div class="contentbox"> 
                <div id="movies" class="tabcontent"> 
                    Download movies here 
                </div>
                <div id="comments" class="tabcontent">
                    Put comments here
                </div>
            </div>
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is my HTML set up for the tabs which all works fine, i
I'am build an app with an ActionBar and two Tabs below. Everything works fine
Below is the code I'm using. Right now the tabs section works fine and
Ive got a jquery app that has several grids (jqgrid) in defferent tabs. Below
I have a loading image that works using the code below. It shows the
How can I have different colors for different tabs in SuperTabNavigator. Below is the
Below is code to an inherited ComboBox. The issue is that the ComboBox is
below is the code to download a txt file from internet approx 9000 lines
Below is my main activity file. I am stuck with the bottom area (commented
If you click the dropdowns at this site: http://ryanbent.com/ - I want each of

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.