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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:35:56+00:00 2026-06-15T03:35:56+00:00

On my site I use one core/frame PHP file. If user hit one of

  • 0

On my site I use one core/frame PHP file. If user hit one of my link (like contact, our about..etc..) the content loaded via ajax. I use the following snippet to achieve this:

var AjaxContent = function(){
    var container_div = ''; 
    var content_div = ''; 
    return {
        getContent : function(url){
            $(container_div).animate({opacity:0}, 
                function(){ // the callback, loads the content with ajax
                    $(container_div).load(url, //only loads the selected portion
                        function(){                        
                           $(container_div).animate({opacity:1}); 
                    }

                );        
            });
        },
        ajaxify_links: function(elements){
            $(elements).click(function(){
                AjaxContent.getContent(this.href);
                                    

                return false; 
                
            });
        },
        init: function(params){ 
            container_div = params.containerDiv; 
            content_div = params.contentDiv;
            
            return this; 
        }
    }
}();

I need help how to integrate a preloading, so if visitors hit one of my link (for example the gallery menu) will see a little loading image, because now they see the big white nothing for long – long seconds.

  • 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-15T03:35:57+00:00Added an answer on June 15, 2026 at 3:35 am

    Add loading image beforing ajax call and after you get response from server simply replace that image with data like the one below

     function(){ // the callback, loads the content with ajax
            $(container_div).html("<img src='loading.gif' />");//add image before ajax call
            $(container_div).load(url, //only loads the selected portion
            function(){
             $(container_div).html(data);//replace image with server response data                        
            $(container_div).animate({opacity:1}); 
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm switching over our site to use Asynchronous Google Analytics, and I'm curious about
We use Magento in conjunction with EE for our site. In one of my
Hi I have a site where I use a User Table. I want to
I have one core site which has all the core functions. I then need
When a user log into my asp.net site I use the following code: FormsAuthentication.RedirectFromLoginPage(userid,
I'd like to create one jar file to execute that is implemented with java
I'm trying to use one of these: http://www.eyecon.ro/bootstrap-datepicker/ However, I'd like it to be
The Django admin site makes use of a really cool widget: How can I
On my site I use require.js to manage my code, on the main page

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.