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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:18:45+00:00 2026-05-18T05:18:45+00:00

Hello I have site where I show/hide divisions that are loaded by default at

  • 0

Hello I have site where I show/hide divisions that are loaded by default at start. But the problem is that when I refresh page it is always going back to main division. Is there any way I can do something like mysite/#news mysite/#about?

Code that I have:

        $('a#btnNews').click(function()
        {
            $('#divabout').hide();
            $('#divnews').fadeIn();
            $('#pagetimer').load('scripts/loadtimer.php');
            return false;
        });

        $('a#btnAbout').click(function()
        {
            $('#divrooster').hide();
            $('#divabout').fadeIn();
            $('#pagetimer').load('scripts/loadtimer.php');
            return false;
        });
  • 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-05-18T05:18:46+00:00Added an answer on May 18, 2026 at 5:18 am

    Throughout this you can use window.location.hash instead.

    if (location.hash != "") {
      $('a#'+location.hash).click();
    }
    $('a#btnNews').click(function()
    {
      $('#divabout').hide();
      location.hash = 'btnNews';
      $('#divnews').fadeIn();
      $('#pagetimer').load('scripts/loadtimer.php');
      return false;
    });
    $('a#btnAbout').click(function()
    {
      $('#divrooster').hide();
      location.hash = 'btnAbout';
      $('#divabout').fadeIn();
      $('#pagetimer').load('scripts/loadtimer.php');
      return false;
    });
    

    Make sure to put all this inside either $(function(){}); or $(document).ready(function(){});!

    You can either use $('a#'+location.hash).click(); or you can change the hash to fade in the targeted div directly.

    You can also use e.preventDefault() instead of return false;. (It also works better) E.g.

    $('a#btnNews').click(function(e) {
    e.preventDefault();
    ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have applied jquery show/hide function in my website but the problem is
Hello i have a big problem .. I'm creating a user login site but
Hello I have next function, what always return null as result, but service calling
hello i have just start using Raphael but i'm very confused in the following
Hello I currently have a site that is very simple. It consists of a
Let say that i have this to url's site.com/hello-world/test.html site.com/hello-world/test/test.html if i go to
Hello fellow stackies, I'm developing a site and I have a small problem. It's
hello i have a problem with my site. i have a site where urls
Hello everybody i have a problem that when i click a button it remains
hello I have my code that connects to my ftp server $conn_id = ftp_connect($ftp_server);

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.