Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Mouse Cursor for whole page?

I have a drag UI program, where the mouse cursor on the draggable element changes to a grabbing hand on click.

The problem is, I allow the drag to happen anywhere on screen, and the cursor changes over anchor tags, etc...

I've tried $('*').addClass('grabbing'), but it's REALLY expensive.

Is there a simple easy code efficient way to handle this?

like image 405
Wesley Avatar asked Oct 12 '11 15:10

Wesley


People also ask

How do I permanently change my cursor?

Customizing cursors Step 1: Navigate to the Mouse properties window as we did earlier. Step 2: Select the Pointers tab. Step 3: To select a custom cursor for the highlighted individual icon, click Browse. Step 4: That will open the default cursors folder, where hundreds of different cursor options are available.

How do I change my mouse cursor to custom one in Windows 11?

Fortunately, you can do this in Windows 11, and here is how. Access the Mouse properties menu like earlier shown and navigate to the Pointers sub-menu. Select the cursor you would like to change in the Customize menu and click Browse.


1 Answers

Do it at the CSS level:

* {
   cursor: pointer;
}

doing it in jquery forces it to iterate every single node in the dom and rewrite its css classes. On a long document, that's a huge waste of time.

like image 122
Marc B Avatar answered Sep 30 '22 06:09

Marc B