Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to set loading image for all button click events depends up on loading time

for page its coming but not for all cilck events.

i tried like this
JavaScript
$(window).load(function () {
    $("#pageloaddiv").fadeOut(2000);
});

$(document).ready(function () {
    $('button').click(function () {
        $("#pageloaddiv").show();
        $("#pageloaddiv").fadeOut('slow');
    });
});

with css also.


[Edit member="Tadit"]
Added pre tags.
[/Edit]
Posted
v2
Comments
Sergey Alexandrovich Kryukov 16-Oct-14 2:54am    
Not clear. What does it mean, "depends on loading time"?
—SA
gnani_pal 16-Oct-14 3:08am    
for example if i click on some button it take some time right? (when ever the data is loading at that time only)
in that i want some animation image like progress bar or circles or any type of images, i getting at page load, but not button click events.
gnani_pal 16-Oct-14 3:09am    
$(window).load(function () {
$("#pageloaddiv").fadeOut(2000);
});


not like this. we should not give time, how much time it will load at that time only i want loading image.

1 solution

Quote:
for example if i click on some button it take some time right? (when ever the data is loading at that time only)
in that i want some animation image like progress bar or circles or any type of images
See the below articles.

1. Show progress bar on Button Click in ASP.Net[^]
2. jQuery Display Progress Bar on Button Click in Asp.net[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900