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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:56:46+00:00 2026-06-12T02:56:46+00:00

I can’t when I enter url value so title don’t change and first content

  • 0

I can’t when I enter url value so title don’t change and first content don’t hide how can use with enter with url change title and hide first pagecontent ?

<script type="text/javascript">
    $(function() {
    var pagecontent = $(".page_content");
    var pages = $("ul.pages li,#logo");
    var hash = window.location.hash;
    var title = document.title;

    pagecontent.not(hash).hide();
    pages.first().addClass("active").show();
    pagecontent.first().show();
    pages.find('[href=' + hash + ']').addClass('active');
    pages.find('[href=' + hash + ']').parent().closest('li').addClass('active');

    pages.click(function() {
        $(this).addClass('active').siblings().removeClass('active');
        $(this).parent().closest('li').addClass('active').siblings().removeClass('active'); 
        pagecontent.hide();
        var activepage = $(this).find("a").attr("href");

        $(activepage).fadeIn();
        title = $('h2', activepage).first().text();   
        $('title').text(title);
        return false;
    });
});
</script>

When I tried to enter the url does not change the title and pagecontent.first remain there

  • 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-12T02:56:47+00:00Added an answer on June 12, 2026 at 2:56 am

    Fixed. Here it is:

    $(function() {
        var pagecontent = $(".page_content");
        var pages = $("ul.pages li,#logo");
        var hash = window.location.hash || "#home";
        var title = document.title;
    
        // new block
        var titlex = $('h2', hash).first().text();
        document.title = titlex;
        $(hash).show();
    
        $('ul.pages a[href="' + hash + '"]')
            .addClass("active")
            .closest("li")
                .addClass("active");
        // end
    
        pagecontent.not(hash).hide();
        pages.click(function() {
            $(this).addClass('active').siblings().removeClass('active');
            $(this).parent().closest('li').addClass('active').siblings().removeClass('active'); 
            pagecontent.hide();
            var activepage = $(this).find("a").attr("href");
            window.location.hash = activepage;  //new: fix location hash
            $(activepage).fadeIn();
            title = $('h2', activepage).first().text();   
             $('title').text(title);
            return false;
        });
    });
    

    We could discuss the style but this works.

    EDIT: Note that click handler sets appropriate location hash. Seems like right decision but it causes flicker in browser title bar. If it bothers you, try replacing

    window.location.hash = activepage;
    $('title').text(title);
    

    with

    if( history.pushState ) {
        history.replaceState({}, title, activepage);
    } else {
        window.location.hash = activepage;
        document.title = title;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone let me know how can we change the value of kendo combobox
Can someone guide me on a possible solution? I don't want to use /bin/cp
can anyone help me with this if else statement.... Coding <script> $(#id_add_select).change(function(){ if($(#id_add_select ==
Can I order my users in the database, so I don't have to say
Can I change the field public virtual ClassOne ClassOne { get; set; } to
Can we change the default action of the edit selected row button? Here is
Can anyone enlighten me to a way I can Highlight the content of an
Can anybody help me? What should be the datatype for this type -07:00:00 of
Can we change the color of the divider? Apple documentations says, that we can
Can anyone explain me what's going on? I use this method - (BOOL)shouldAutorotateToInterfaceOrientation:( UIInterfaceOrientation)interfaceOrientation

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.