I have a <button>
, when the user hover it, the cursor bee pointer (via CSS).
When the user click on the <button>
, the cursor of all the page should bee wait
(via jQuery).
However, if the user keeps the cursor inside <button>
, it will stay as pointer
. How can I fix this ?
Live example : /
Tested with Chrome 36.0.1985.125 (last version)
I have a <button>
, when the user hover it, the cursor bee pointer (via CSS).
When the user click on the <button>
, the cursor of all the page should bee wait
(via jQuery).
However, if the user keeps the cursor inside <button>
, it will stay as pointer
. How can I fix this ?
Live example : http://jsfiddle/URuLa/
Tested with Chrome 36.0.1985.125 (last version)
Share Improve this question asked Jul 24, 2014 at 3:29 lepixlepix 4,9906 gold badges43 silver badges53 bronze badges2 Answers
Reset to default 7Add a class for html that sets the cursor and sets all elements to also have the wait cursor when html has that class
CSS
html.wait, html.wait * {
cursor:wait;
}
then instead of doing
$('html').css("cursor","wait");
use addClass to add the wait class to html
$('html').addClass("wait");
JSFiddle Demo
Then when done just use removeClass to remove the class
You can change the cursor property for your button in the click
callback.
$(document).ready(function(){
$("button").click(function() {
$('html').css('cursor','wait');
$(this).css('cursor','wait');
});
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744367815a4570795.html
评论列表(0条)