เปลี่ยนข้อความเมื่อเลื่อนเม้าส์ไปโดน

ตัวอย่าง code ง่ายๆในภาษา Wolfram เผื่อเป็นประโยชน์ครับ

OverviewMouseover[header_, subs_] := 
 CellPrint@
  Cell[BoxData[
    ToBoxes@Mouseover[
      Framed[Style[header, "OverviewSection"], 
       FrameMargins -> {{15, 15}, {5, 5}}, FrameStyle -> None, 
       RoundingRadius -> 5],
      
      Evaluate@
       If[subs == "", 
        Framed[Style[header, "OverviewSection", White], 
         FrameMargins -> {{15, 15}, {5, 5}}, FrameStyle -> None, 
         RoundingRadius -> 5, Background -> m8red[1]], 
        Row[{Framed[Style[header, "OverviewSection", White], 
           FrameMargins -> {{15, 15}, {5, 5}}, FrameStyle -> None, 
           RoundingRadius -> 5, Background -> m8red[1]], " » ", 
          Framed[Style[subs, "OverviewSection"], 
           FrameMargins -> {{15, 15}, {5, 5}}, FrameStyle -> m8red[1],
            RoundingRadius -> 5, Background -> White]}]]]], 
   "OverviewSection"]
%d bloggers like this: