anonn023432
anonn023432

Reputation: 3120

Loading animation not working

I am following this tutorial: https://blog.oio.de/2010/11/08/how-to-create-a-loading-animation-spinner-using-jquery/ I made the loader as a gif but when I click on a link the loader is not working. I used the second part of loader where it can be added to a link.

Here is a link to the jsfiddle containing a part of my code: http://jsfiddle.net/rohitbegani/DcV8C/

$(document).ready(function(){
$('#button-upload').click(function() {
$('#spinner').show();
});
});

Main javascript used for getting on-click animation.

Can't actually load the gif file on fiddle as I don't know how to add external images/gif to a jsfiddle code(if it is at all possible)

Upvotes: 0

Views: 461

Answers (2)

user3263978
user3263978

Reputation: 193

http://jsfiddle.net/DcV8C/2/

updated your fiddle, the 'button-upload' is a class not an ID so

$(document).ready(function(){
    $('.button-upload').click(function() {
        $('#spinner').show();
    });
});

Upvotes: 1

Brian Putt
Brian Putt

Reputation: 1358

You need to remove the # and replace with a period as it's a class for the button-upload.

$(document).ready(function(){
    $('.button-upload').click(function() {
        $('#spinner').show();
    });
});

Upvotes: 1

Related Questions