Reputation: 2563
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
Reputation: 9060
What about this :
$(".test").click(function () {
$("#justamoment").css("visibility", "visible");
});
Upvotes: 1
Reputation: 727
Try this
USe 'click
' instead of 'change
' . It will work
Wokring fiddle fine
Upvotes: 1
Reputation: 388316
You need to have a click handler not change
$(".test").click(function () {
$("#justamoment").css("visibility", "visible");
});
Demo: Fiddle
Upvotes: 3