Karthiga Karthiga - 1 month ago 9
CSS Question

Jquery allow cursor to progress before document.ready function

In my project i want the cursor to progress state before document ready function and after the entire page is rendered it need to change the cursor to default state.

(function($) {
$('body').css('cursor','progress');
$(document).ready(function() {
$('body').css('cursor','progress'); }


This my code can anyone please help me out

Answer

What you could do is something like this add a css rule for the body cursor

<style>
html {
  cursor: progress;
}
<style>

then just change the cursor again when page finish rendering all the contents.

$(window).on('load',function() {
    $('html').css('cursor','default'); 
}