Suraj
Suraj

Reputation: 2563

add spinner in the place of button on click event

I want to add a spinner below or in the place of the button on click event. I am trying with something like this.

not able to get this working.

Here's the fiddle.

<div class = "example test">
  <img src="http://www.fordesigner.com/imguploads/Image/cjbc/zcool/png20080526/1211776983.png" onclick="$('.test').click();">  
  <div id="justamoment" style="text-align: left;font-family:  Signika;color: white;font-size:14px;font-weight: bold;text-decoration: none;visibility:hidden">
  <p>
     <img src="http://www.ajaxload.info/cache/FF/FF/FF/00/00/00/1-0.gif" height="12" width="12" Just a moment..
   </p>
   </div>
      <script>
       $(".test").change(function(){
     $("#justamoment").css("visibility","visible");
 });
      </script>

Please help.

Upvotes: 1

Views: 1840

Answers (3)

Norlihazmey Ghazali
Norlihazmey Ghazali

Reputation: 9060

What about this :

 $(".test").click(function () {
    $("#justamoment").css("visibility", "visible");
 });

DEMO

Upvotes: 1

Vishnu Prasad
Vishnu Prasad

Reputation: 727

Try this

USe 'click' instead of 'change' . It will work

Wokring fiddle fine

Upvotes: 1

Arun P Johny
Arun P Johny

Reputation: 388316

You need to have a click handler not change

$(".test").click(function () {
    $("#justamoment").css("visibility", "visible");
});

Demo: Fiddle

Upvotes: 3

Related Questions