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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:59:34+00:00 2026-06-14T12:59:34+00:00

So, I got the script from : http://css-tricks.com/dynamic-page-replacing-content/ and edited it to my needs.

  • 0

So, I got the script from : http://css-tricks.com/dynamic-page-replacing-content/
and edited it to my needs. It works well with “jquery-1.4.4”. But the active class assignment for the menu buttons dont work with “jquery-1.5 and later versions”.

This is the script:

$(function() {
var newHash      = "",
    $mainContent = $("#main-content"),
    $el;        

$("nav").delegate("a", "click", function() {
    window.location.hash = $(this).attr("href");
    return false;
});

$(window).bind('hashchange', function(){    
    newHash = window.location.hash.substring(1);                                                        
    if (newHash) {
        $mainContent
            .find("#guts")
            .fadeOut(600, function() {                     
                $mainContent.hide().load(newHash + " #guts", function() {   
                    $mainContent.fadeIn(600, function() {

                    });                     
                    $("nav a").removeClass("active");
                    $(" a[href="+newHash+"]").addClass("active");
                });
            });
    };     
});
$(window).trigger('hashchange');

});

Than I have this simple ajax loading-spinner code which also doesnt work with the latest jquery:

$(document).bind("ajaxSend", function(){
$('#spinner').fadeIn("fast");
 }).bind("ajaxComplete", function(){
    $('#spinner').delay(600).fadeOut("slow");
 });

I would be grateful for any help.

  • 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-14T12:59:36+00:00Added an answer on June 14, 2026 at 12:59 pm

    I think your issue is here:

    i am not sure but try if this works for you.

    $(" a[href='"+newHash+"']").addClass("active");
           //  ^-----------^-----------you have missed the " ' " single quotes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am playing around with phpwebsocket. I got the code from http://code.google.com/p/phpwebsocket/ . the
Ok, I've got this code: <html> <head> <meta http-equiv=Content-Type content=text/html; charset=iso-8859-1> <script type=text/javascript href=https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js></script>
I am using an horizontal accordion from here: http://www.dynamicdrive.com/dynamicindex17/haccordion.htm I got it to display
I've got a page under http://www.example.com/abc/def/a/ where a user can buy products. For a
I've got a script that reads in from a CSV file and sometimes the
I have a select-all jquery script I got from a site (I forgot the
I've got a bash script that reads input from a file like this: while
I've got a perl script that loads data from an Excel XLS file into
How do I execute an output piped from a bash script? I got this
So, I have a website with an autoFontSize script (Got it from stackoverflow, but

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.