Share the post "How To Change Cursor When Hover Or MouseOver On Surface In Famo.us"
Changing the mouse cursor when you hover it over a Surface object in Famo.us is very easy. You do not have to explicitly turn on the mouseover and mouseout events of the Surface just to change cursors.
Simply specify it within the Surface property attribute when you create a new instance of it, like this:
|
1 2 3 4 5 6 7 8 9 10 |
new Surface({ size: [100, 100], content: 'My Surface', properties: { color: 'red', textAlign: 'center', backgroundColor: 'white', cursor: 'pointer' }, }); |
That’s it! When you hover your mouse cursor on the Surface object, its cursor will change. It will also change the cursor back to default when your cursor moves out of the Surface area.









