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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:34:03+00:00 2026-06-01T13:34:03+00:00

I am redesigning my personal / development website , and trying to make it

  • 0

I am redesigning my personal / development website, and trying to make it as user friendly as possible.

I wanted to load new pages with AJAX and slide them in, and that’s what’s currently happening.
Everything works in all current browsers (except IE, but I’ll work on that in the future).

However, there’s a strange spacing jump in my navigation menu on the first (and only first) page change. After the page changes once, the navigation spacing stays the same.

  • On page load
    Layout differences
  • After a link is clicked

When a link is clicked, the navigation section from the new page is set to replace the current navigation, because each link has a data-offset attribute that’s calculated by the server backend so that the javascript knows which direction and how far to slide the elements when they are clicked.

The way I’m currently doing it, it’s either [the content width] or –[the content width].

However, the structure of the menu never changes, and the stylesheet is completely static. I have inspected all of these elements in Firebug, and nothing changes across page loads.

I linked the site, http://next.randolphwebdevelopment.com above, but I’ll copy some of the pertinent Javascript here to give an idea of what’s happening.


Pulls the entire page down that the link would redirect to (unless specified, all future code blocks are also inside this callback):

$.get( loc, function( data ){
    //delete the doctype declaration
    data = data.split("\n").slice(1).join("\n");
    next_page = $(data.replace(/(\r\n|\n|\r)/gm,"").replace(/>\s*</gm,'><'));

Replaces the navigation with the new navigation from the target page (all that really changes is the data-offset attribute on each link):

//insert the new navigation
$('#header-content nav').html(next_page.find('#header-content nav').html());
$('#header-content nav a').click( navigation_clickHandler );

That’s really it. There’s a bunch of code to insert the new content and slide it in, as well as changing the page title, setting history states, etc., but this is the only code that touches the navigation menu, and there’s no code that touches any stylesheets.

I’m open to any suggestions that fix the problem and/or improve the code design.

  • 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-01T13:34:05+00:00Added an answer on June 1, 2026 at 1:34 pm

    At first load nav is got from the server w/o php. I bet you wrote this html manually with intendation and so on.

    After any click js recreates nav, but now w/o empty text nodes. Just <a>link1</a><a>link2</a>.

    Add spaces or remove them from source html.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we at our company are trying out some new technologies so thought of redesigning
Hey all,     I'm redesigning the infrastructure for a website, and I want to make
I am redesigning a new website and my database table need tidying up a
I am redesigning my website and in the process restructuring some of the linking
Our team is currently working on completely redesigning our school's website and one of
I'm the processing of redesigning a website that uses hover effect on a button
i have a new website (i'm building one right now) and i want to
I am redesigning a client's website so they will be able to edit the
I am working on redesigning a website for my fathers business based on the
I am redesigning a website to better work with mobile devices. My problem is

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.