amit
amit

Reputation: 10261

start to load on click()

i want some content to start loading when i click on a link. i dont want it to use any bandwidth before i click on that link. also how to implement that rotating cursor animation that is seen in almost all lightboxes?

Upvotes: 0

Views: 107

Answers (1)

Calvin
Calvin

Reputation: 8765

Use the $.ajax() function to load content dynamically.

For the animation, find an animated .gif (http://www.ajaxload.info can generate one for you). What I usually do is:

$(element).html('<img src="loading.gif">');

Then run your ajax function, and on success replace the loading gif with the loaded content.

Upvotes: 3

Related Questions