06_Menu/Menu_01b.htm
1 <html xmlns:t ="urn:schemas-microsoft-com:time">
2 <head>
3 <title>Menu_01</title>
4 <?import namespace="t" implementation="#default#time2">
5 <style>
6 .Menu {
7 position:absolute; left:10px; top:90px;
8 height:20; width:150; display:none;
9 border-width:1px; border-style:solid;
10 text-align:center;
11 }
12 </style>
13 <script type="text/javascript" >
14 // Vychodzia pozicia
15 var x=10;
16 var y=90;
17
18 function PosunMenu()
19 {
20 M1.style.display='block';
21 A1.path=Cesta(x,y, event.clientX, event.clientY);
22 A1.beginElement();
23 // Zaznamenanie pozicie
24 x=event.clientX;
25 y=event.clientY;
26 }
27
28 function Cesta(xz, yz, xc, yc)
29 {
30 var c;
31 c = " M " + xz + " " + yz;
32 c += " L " + xc + " " + yc ;
33 return c;
34 }
35
36 function SkryMenu()
37 {
38 M1.style.display='none';
39 }
40
41 // Zmena zobrazenia polozky pri presune nad a mimo
42 function Nad (M) { M.style.backgroundColor='#ffcc00'; }
43 function Mimo(M) { M.style.backgroundColor='#ffffff'; }
44
45 // Obsluzna funkcia polozky menu
46 function OF1 ()
47 {
48 alert("Kuko");
49 }
50 </script>
51 </head>
52 <body oncontextmenu="PosunMenu(); return false;";
53 onclick = "SkryMenu();" >
54 <h2>Obsluha udalostí</h2>
55 <span class="Menu" id="M1" onclick="OF1()";
56 onmouseover="Nad(this)" onmouseout="Mimo(this)" > Kuko </span>
57
58 <t:animateMotion id="A1" targetElement="M1" origin="parent"
59 begin="indefinite" dur=".2" fill="freeze" />
60 </body>
61 </html>