/    Sign up×
Community /Pin to ProfileBookmark

Preloading Ajax content help needed!

Hi there.

I’ve been having a lot of trouble the last week dealing with loading in some content the way I’d like through Ajax using jQuery.

I have the basic functionality fine, with the remote .html being loaded in when a navigation link is clicked.

This can be viewed here [url]http://www.ascent-interactive.co.uk/testing/DEV.html[/url] (only the top nav links work at present).

However, what I have been trying to achieve is,

1.) To preload the remote .html content (with an appropriate animated .gif being displayed).

2.) And once the external content has preloaded, display it with a jQuery effect, such as fadeIn.

My code at present, which only achieves loading the content in, is as follows:

<script type=”text/JavaScript”>
$(document).ready
(
function()
{
$(“ul.navigation a”).click
(
function()
{
$(“.overlay_layer”).load(jQuery(this).attr(“href”));
return false;
}
);
}
);
</script>

Any help about how to achieve the preloading, would be greatly, greately appeciated, as I’m completely lost about how to achieve this.

Thanks in advance

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Angry_Black_ManSep 10.2007 — sorry, most people here dont know the libraries, they know raw javascript. id suggest any forums that JQUERY has to get a better answer for their proprietary language.
×

Success!

Help @Matt81 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...