Solved

Jquery Load Delay

Posted on 2013-02-01
2
170 Views
Last Modified: 2013-02-19
Hi Guys,

I have this script:
$(function() {
    $(".wcGridCol li").click(function() {
	$('#ContentContainer').fadeIn('slow');
        $('.Loader').fadeIn('slow');
        $("#ContentContainer").load("article.html", function(){ });
        return false;
    });
});

Open in new window


I am trying to add a delay on the load function so .Loader displays for 2 seconds as a minimum rather than load content immediately.

Then I would like to add a fadein effect to the loaded content.

Could someone assist.. Many thanks in advance
0
Comment
Question by:maccaj51
2 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
ID: 38844200
I don't know if it would work the the .load api or not....but try adding a .delay(2000)

example:
$("#ContentContainer").delay(2000).load("article.html", function(){ });

Open in new window

0
 

Author Closing Comment

by:maccaj51
ID: 38905925
Many Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now