Adding a hand and pointer CSS style dynamically to an Element

158 views
Skip to first unread message

Jason Sapp

unread,
May 22, 2013, 3:36:22 PM5/22/13
to mi...@dartlang.org
I have a newbee question about how to add two CSS styles to a DOM Element with the same name.  This is a bad example, but lets say that I wanted to add  ('cursor=hand; cursor=pointer' styles to a particular element).

I've tried:
----------------
elem.style.cursor = "pointer";  // Obviously works

----------------
elem.style.cursor = "hand";  // Doesn't work

----------------
elem.style.cursor = "hand; cursor";  // Doesn't work


Thanks,

Jason

Seth Ladd

unread,
May 22, 2013, 8:00:28 PM5/22/13
to General Dart Discussion
Hi Jason,

Many CSS properties expect a single value. You can set multiple classes on an element, which is a common practice. Can you be more specific, and we'll try to help more.

Thanks,
Seth


--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new
 
 

Jason Sapp

unread,
May 22, 2013, 8:33:42 PM5/22/13
to mi...@dartlang.org
Seth,

You actually answered my question.  Thanks.

Jason

Jos Hirth

unread,
May 23, 2013, 4:28:13 AM5/23/13
to mi...@dartlang.org
There is no "hand" cursor.

CSS attributes which take multiple values generally use comma as separator.


Matthew Butler

unread,
May 23, 2013, 8:42:28 AM5/23/13
to mi...@dartlang.org


On Thursday, May 23, 2013 5:28:13 AM UTC-3, Jos Hirth wrote:
There is no "hand" cursor.

This is probably one of the most important issues you were running into with your code. Check out this site for a brief rundown of cursor types and a demo in which you can easily see them all.


Matt 

Jason Sapp

unread,
May 23, 2013, 8:59:24 AM5/23/13
to mi...@dartlang.org
Thanks Jos and Matthew.  I knew that hand is no longer used (since I think IE 5).  I was just curious if there was a way to support multiple values of the same CSS style.  But, at the end of the day, I really don't think it's needed because (as Seth mentioned), you can implement this functionality just fine with CSS classes.....

Jason


--
Reply all
Reply to author
Forward
0 new messages