user1688346
user1688346

Reputation: 1970

Set cursor to wait after clicking

When I click on a button, the cursor does not change the loading. Any ideas how to achieve this?

Here is my code:

<div class="signup">
    <input type="submit" value="Sign Up" title="SignUp" id="SignUp" class="btn" />
</div>  

Css

#SignUp
{
    float: left;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    vertical-align: central;
    margin-top: 0px;
    width: 100px;
    color: white;
    background-color: #5BB75B;
    background-image: -moz-linear-gradient(top, #62C462, #51A351);
    background-image: -ms-linear-gradient(top, #62C462, #51A351);
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62C462), to(#51A351));
    background-image: -webkit-linear-gradient(top, #62C462, #51A351);
    background-image: -o-linear-gradient(top, #62C462, #51A351);
    background-image: linear-gradient(top, #62C462, #51A351);
    background-repeat: repeat-x;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);
    border-color: #51A351 #51A351 #387038;
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
    filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
    margin-left: 10%;
}

Upvotes: 1

Views: 2326

Answers (1)

Georgi Atsev
Georgi Atsev

Reputation: 3045

You can bind to the onclick event of the button using jQuery, then set a class on the body/page content that will cause the cursor to be waiting.

// Javascript
$(function() {
  $('input#SignUp').click(function() {
    $('body').addClass('cursor_wait');
  }
});

/* CSS */
.cursor_wait {
  cursor: wait
}

Upvotes: 3

Related Questions