Solved

Jquery Load Delay

Posted on 2013-02-01
2
169 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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 …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

757 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

21 Experts available now in Live!

Get 1:1 Help Now