Could anyone point out why this is not working in Mathematica 8:
DynamicModule[{x = Pink},
Row[
{Style["Hello", x],
Mouseover[
x = Green; "World",
x = Blue; "World"]}]]
What I expect is to see the color of "Hello" change when I mouse over "World". What I am getting is a pink "Hello" that never changes color.
The mouseover event is fired at an Element when a pointing device (such as a mouse or trackpad) is used to move the cursor onto the element or one of its child elements.
A mouseover is an event that occurs in a Graphical User Interface (GUI) when the mouse pointer is moved over an object on the screen such as an icon, a button, text box, or even the edge of a window.
mouseover is a special event which is related to the JavaScript and occurs whenever the mouse in pointer comes over an element. Each mouseover event occurs because they have some special property attached to the relatedTarget. mouseover property gets complimented with the target element of the mouseout event.
I think I have waited long enough to be fair. Here is my proposal:
DynamicModule[{x = Pink},
Row[{
Dynamic@Style["Hello", If[MouseAnnotation[] === 1, x = Green; Blue, x]],
Annotation["World", 1, "Mouse"]
}]
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With