Mouseover[expr,over]
represents an object that displays as over when the mouse pointer is over it, and as expr otherwise.
Mouseover
Mouseover[expr,over]
represents an object that displays as over when the mouse pointer is over it, and as expr otherwise.
Details and Options
- Mouseover can be used with graphics or any other expression.
- The following options can be given:
-
Alignment {Left,Top} how to align objects in the display area ImageSize Automatic the overall image size for the displayed objects - With the default option setting ImageSize->Automatic, Mouseover leaves space only for the object currently being displayed.
- With the option setting ImageSize->All, Mouseover leaves enough space for either expr or over.
Examples
open all close allBasic Examples (1)
Scope (4)
Mouseover[x, Graphics[Disk[], ImageSize -> 50]]1 / Mouseover[x, Graphics3D[Sphere[], ImageSize -> 50]]Grid[{{a, Mouseover[x, Grid[{{e, f}, {g, h}}]]}, {c, d}}]Expand[(Mouseover[x, Style[xxxx, Red]] + y) ^ 3]Graphics[Mouseover[Disk[], Circle[]], ImageSize -> 50]Graphics[Table[Mouseover[Point[p], {Point[p], Arrowheads[.1], Arrow[{Scaled[{1, 1}], p}]}], {p, RandomReal[1, {10, 2}]}]]ImageSize->All keeps the overall size constant regardless of which expression is visible:
Row[{"xxx", Mouseover["A very long string.", "Short!"], "xxx"}]Row[{"xxx", Mouseover["A very long string.", "Short!", ImageSize -> All], "xxx"}]Use Dynamic to recompute the tooltip every time it is looked at:
Mouseover[date, Dynamic[DateString[], UpdateInterval -> 1]]Options (6)
Alignment (1)
Align within Mouseover:
Grid[Table[Framed[Mouseover[x + y, Style[x + y, Red], ImageSize -> {50, 25}, Alignment -> {w, h}]], {h, {Top, Center, Bottom}}, {w, {Left, Center, Right}}]]Background (1)
BaselinePosition (1)
FrameMargins (1)
Add margins to Mouseover:
Table[Framed[Mouseover[x + y, Style[x + y, Red], FrameMargins -> m]], {m, {0, 10, 20}}]ImageMargins (1)
Add margins to Mouseover:
Table[Framed[Mouseover[x + y, Style[x + y, Red], ImageMargins -> m]], {m, {0, 10, 20}}]ImageSize (1)
Control the overall size of Mouseover:
Grid[Table[Framed[Mouseover[x + y, Style[x + y, Red], ImageSize -> {w, h}]], {h, {30, 50, 70}}, {w, {50, 70, 100}}]]Applications (1)
Use Mouseover to find the rule number of a particular CellularAutomaton:
Table[Mouseover[ArrayPlot[CellularAutomaton[n, {{1}, 0}, {10, All}], ImageSize -> 50], n, Alignment -> Center, ImageSize -> All], {n, 64}]Properties & Relations (1)
Mouseover changes the expression itself:
Mouseover[x + y, label]StatusArea presents the label in the status area:
StatusArea[x + y, label]Tooltip presents the label in a popup box:
Tooltip[x + y, label]Possible Issues (1)
Neat Examples (1)
Table[Mouseover[Graphics[Circle[], ImageSize -> RandomReal[100]], Graphics[Disk[], ImageSize -> RandomReal[100]]], {5}]Tech Notes
History
Text
Wolfram Research (2007), Mouseover, Wolfram Language function, https://reference.wolfram.com/language/ref/Mouseover.html.
CMS
Wolfram Language. 2007. "Mouseover." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Mouseover.html.
APA
Wolfram Language. (2007). Mouseover. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Mouseover.html
BibTeX
@misc{reference.wolfram_2026_mouseover, author="Wolfram Research", title="{Mouseover}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Mouseover.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mouseover, organization={Wolfram Research}, title={Mouseover}, year={2007}, url={https://reference.wolfram.com/language/ref/Mouseover.html}, note=[Accessed: 12-June-2026]}