Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cursor:pointer on hover html5 canvas element

Is there any way to do this to let the user know the element is clickable?

I have been using easeljs but haven't found anything related.

like image 977
chrysillo Avatar asked Sep 26 '12 19:09

chrysillo


People also ask

What is cursor in HTML?

HTML cursor property works based on style property within HTML tag. We will investigate some different cursor syntax in HTML. How Cursor Look Like? Based on the text cursor will change automatically. By default, an arrow cursor. No cursor is displayed. Help information with an arrow question mark.

How to change the cursor of hyperlink while hovering?

How to Change the Cursor of Hyperlink while Hovering ¶ The default cursor for a hyperlink is "pointer". To change it, you need to specify the cursor type for your <a> element with the CSS :hover selector. In our example, we style only the "link" class.

How to turn a mouse pointer into a hand pointer in HTML?

But if you want to have a hand pointer for all of your list items, just set the style for the <li> element. Now let’s see an example of changing a mouse pointer into a hand pointer by using the "pointer" value of the cursor property. We set that cursor type only on the "pointer" class.

How do I add text on hover in CSS?

Watch a video course CSS - The Complete Guide (incl. Flexbox, Grid & Sass) To add a text on hover, you’ll need to use the title attribute. In this snippet, we'll use it on the <div>, <span>, <abbr>, and <p> elements. Hover this text to see the result.


2 Answers

You could use this: How to make clickable points in html5 canvas?

and while the mouse is in that area, you can set: $('#canvasID').css('cursor','pointer') and $('#canvasID').css('cursor','auto') when it's not over it.

like image 75
Bella Avatar answered Oct 30 '22 15:10

Bella


I am using Easeljs and to get a pointer cursor I use myObject.cursor = 'pointer' and stage.enableMouseOver(20); ( from the DragAndDrop.html example code )

like image 42
kikuchiyo Avatar answered Oct 30 '22 16:10

kikuchiyo