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

  • Home
  • SEARCH
  • 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 8440077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:11:11+00:00 2026-06-10T08:11:11+00:00

Right, so I’m deciding to set myself a challenge as a form of learning

  • 0

Right, so I’m deciding to set myself a challenge as a form of learning curve. I’ve never used ajax before, but I feel it’s something I really must learn, so what better chance to do it than on a new portfolio site.

The main concept of the website involves the content of the website sliding behind folds on the edges of the 960, so you would click on a link and the current content all slides out into the fold it is hidden partially under, the folds would then adjust size to match the new content blocks, and the new content slides in from under the folds. I have this done in a simply manner for the news so far simply using the WordPress loop and some basic jquery. (still can’t manage to get the fold to adjust it’s height properly before the new content coms in)

I have this (http://www.deluxeblogtips.com/2010/05/how-to-ajaxify-wordpress-theme.html) as a basis to start with, but it doesn’t appear to quite achieve my intended goal.

Save setting up some silly jsfiddle, here’s the site as it stands http://paradoxdevelopment.org/

EDIT: Sorry got distracted explaining and forgot to ask the exact question:

How can I make it so that when you click on an internal link, it causes this chain of events:

Content box slides out-> Content changes -> Fold grows -> Content box slides in with new content

EDIT 2: I realised I didn’t really make myself clear again. I have managed to get my head round the ajax to load in the content, the problem is the content loads up in different ways for different pages. For Examples:

The home page has 3 recent sites slide down from a vertical fold at the top, a news post which slides in from the left, and the list of news posts which slide in from the right.

The Work/Play pages have a vertical fold at the top from which blocks slide down.

Contact is a simple full width, so fold on either side filling the 960. The same for the about page for now, although this may have a sidebar in future.

How can I make it so the AJAX can detect what is currently loaded so it knows how to react?

Thank you for any and all help in advance!

  • 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-10T08:11:12+00:00Added an answer on June 10, 2026 at 8:11 am

    Well you’ve pretty much outlined for yourself what you need to do so I’ll provide an untested outline for how to get something like that working.

     function animateInDone () {
          // do something here
     }
    
     function foldReady () {
          // fold has been scaled for this content let's show it on screen
          $('#contentBox').animate(
               {'left':'100px'},
               400,
               'swing',
               complete: animateInDone
          );
     }
    
     function contentLoadDone (responseText, textStatus, XMLHTTPStatus) {
          // new content loaded and displayed on div since we used .load()
          if (textStatus == 'success') {
               // change the fold size
               $('#fold').animate(
                    {height:'350px'}, // or the new height of the contentBox or something else
                    // this can also be {height:'+50px'}
                    400, 
                    'swing', 
                    foldReady
               );
          } else {
               // handle errors
          }
     }
    
     function animateOutDone () {
          // load the new content by using .load or .ajax
          $('#contentBox').load(
               'newcontent.html',
               complete:contentLoadDone
          );
     }
    
     function contentChange () {
          // animate the content box out
          $('#contentBox').animate(
               {'left':window.innerWidth},
               400,
               'swing',
               complete: animateOutDone
          );
     }
    

    I’m not sure about the exact syntax for .animate call but you’ll be able to figure all the possible options for it from the related docs

    • http://api.jquery.com/animate/
    • http://api.jquery.com/load/
    • http://api.jquery.com/ajax/

    Addition to EDIT 2:
    You’ll need to store the state of the UI some where. This can be as simple as having a variable that just stores the name of the current page, or you could have a class hierarchy where each page has their own class with a different UI in/out animation.

    var pageHome = function () {
        this.animIn = function () {
           // animate home page in
        }
    
        this.animOut = function (newpage) {
           // animate home page out and set newpage.animIn as the callback for when the animation in done
        }
    }
    
    var pageNow = pageHome;
    pageNow.animIn();
    

    I personally love having function objects.

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

Sidebar

Related Questions

Right now I have a function, in a class that is used to listen
right now I'm working on my website where the ajax should check if the
Right now what it does is allows me to select files but I need
Right, this is slightly hard to explain but what I'm after is as follows:
Right, i'm new to PHP and mySQL, but i've got a few questions that
Right now I'm using OleDbDataAdapter objDataReader = new OleDbDataAdapter(); objDataReader.SelectCommand = myCommand; objDataReader.Fill(myDataTable); But
Right now I'm learning Opencart, and I'm trying to make my latest product display
Right now I am updating user_list List using jquery and submitting the form data
Right up front: I do not want to start a religious war. I've used
Right now I can call a method using ajax (:remote=> 'true') at awisprotect_path by

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.