Ktos pomoze kto sie zna questionmark.gif smile.gif

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2.  
  3. .buttonA:VISITED {
  4. font-family: Tahoma, Verdana, "MS Sans Serif", "Arial CE", Arial, Helvetica;
  5. font-size: 8pt;
  6. color: #FFFFFF;
  7. text-decoration: none;
  8. font-variant: normal;
  9. font-weight: bold;
  10. }
  11.  
  12. .buttonA:HOVER {
  13. font-family: Tahoma, Verdana, "MS Sans Serif", "Arial CE", Arial, Helvetica;
  14. font-size: 8pt;
  15. color: #FFFFFF;
  16. text-decoration: none;
  17. font-variant: normal;
  18. font-weight: bold;
  19. }
  20.  
  21. .table_buttons {
  22. text-align: center;
  23. color: #FFFFFF;
  24. background-color: #000000;
  25. }
  26.  
  27. .td_buttons {
  28. border: 1px solid #CACACA;
  29. height: 18px;
  30. width: 78px;
  31. }
  32.  
  33. .menuskin{
  34. position:absolute;
  35. width:165px;
  36. background-color: #000000;
  37. border: 1px solid #CACACA;
  38. font-family: Tahoma, Verdana, "MS Sans Serif", "Arial CE", Arial, Helvetica;
  39. line-height:18px;
  40. z-index:100;
  41. visibility:hidden;
  42. }
  43.  
  44. .menuskin a{
  45. text-decoration:none;
  46. color: #ffffff;
  47. padding-left:10px;
  48. padding-right:10px;
  49. }
  50.  
  51. //Pop-it menu- By Dynamic Drive
  52. //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
  53. //This credit MUST stay intact for use
  54.  
  55. var linkset=new Array()
  56. //SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
  57.  
  58. linkset[0]='<div class="menuitems"><a class="buttonA">XXX</a></div>'
  59. linkset[0]+='<div class="menuitems"><a class="buttonA">YYY</a></div>'
  60. linkset[0]+='<div class="menuitems"><a class="buttonA">ZZZ</a></div>'
  61. linkset[0]+='<div class="menuitems"><a class="buttonA">NNN</a></div>'
  62.  
  63.  
  64. ////No need to edit beyond here
  65.  
  66. var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
  67. var ns6=document.getElementById
  68. //var ns6=document.getElementById&&!document.all
  69. var ns4=document.layers
  70.  
  71. function findPosX(obj)
  72. {
  73. var curleft = 0;
  74. if (obj.offsetParent)
  75. {
  76. while (obj.offsetParent)
  77. {
  78. curleft += obj.offsetLeft
  79. obj = obj.offsetParent;
  80. }
  81. }
  82. else if (obj.x)
  83. curleft += obj.x;
  84. return curleft;
  85. }
  86.  
  87. function findPosY(obj)
  88. {
  89. var curtop = 0;
  90. if (obj.offsetParent)
  91. {
  92. while (obj.offsetParent)
  93. {
  94. curtop += obj.offsetTop
  95. obj = obj.offsetParent;
  96. }
  97. }
  98. else if (obj.y)
  99. curtop += obj.y;
  100. return curtop;
  101. }
  102.  
  103. function showmenu(e,which, leftpos, toppos, abspos){
  104.  
  105. if (!document.all&&!document.getElementById&&!document.layers)
  106. return
  107.  
  108. clearhidemenu()
  109.  
  110. var targ;
  111.  
  112. if (!e) var e = window.event;
  113. if (e.target)
  114. targ = e.target;
  115. else if (e.srcElement)
  116. targ = e.srcElement;
  117.  
  118. if (targ.tagName != 'TD') return
  119.  
  120. menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
  121. menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj
  122.  
  123. if (ie4||ns6)
  124. menuobj.innerHTML=which
  125. else{
  126. menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
  127. menuobj.document.close()
  128. }
  129.  
  130. menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
  131. menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
  132.  
  133. eventX=ie4? event.clientX-event.offsetX+30 : ns6? findPosX(targ)+30 : e.x;
  134. eventY=ie4? event.clientY-event.offsetY+15 : ns6? findPosY(targ)+18 : e.y;
  135.  
  136. //Find out how close the mouse is to the corner of the window
  137. var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX;
  138. var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY;
  139.  
  140. //if the horizontal distance isn't enough to accomodate the width of the context menu
  141. if (rightedge<menuobj.contentwidth)
  142. //move the horizontal position of the menu to the left by it's width
  143. menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
  144. else
  145. //position the horizontal position of the menu where the mouse was clicked
  146. menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : eventX
  147. //same concept with the vertical position
  148. if (bottomedge<menuobj.contentheight)
  149. menuobj.thestyle.top=ie4? document.body.scrollTop+eventY : eventY;
  150. //menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : eventY-menuobj.contentheight;
  151. else
  152. menuobj.thestyle.top=ie4? document.body.scrollTop+eventY : eventY;
  153. menuobj.thestyle.visibility="visible";
  154. return false
  155. }
  156. function contains_ns6(a, b) {
  157. //Determines if 1 element in contained in another- by Brainjar.com
  158. while (b.parentNode)
  159. if ((b = b.parentNode) == a)
  160. return true;
  161. return false;
  162. }
  163. function hidemenu(){
  164. if (window.menuobj)
  165. menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
  166. }
  167. function dynamichide(e){
  168. if (ie4&&!menuobj.contains(e.toElement))
  169. hidemenu()
  170. else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
  171. hidemenu()
  172. }
  173. function delayhidemenu(){
  174. if (ie4||ns6||ns4)
  175. delayhide=setTimeout("hidemenu()",1)
  176. }
  177. function clearhidemenu(){
  178. if (window.delayhide)
  179. clearTimeout(delayhide)
  180. }
  181. function highlightmenu(e,state){
  182. if (document.all)
  183. source_el=event.srcElement
  184. else if (document.getElementById)
  185. source_el=e.target
  186. if (source_el.className=="menuitems"){
  187. source_el.id=(state=="on")? "mouseoverstyle" : ""
  188. }
  189. else{
  190. while(source_el.id!="popmenu"){
  191. source_el=document.getElementById? source_el.parentNode : source_el.parentElement
  192. if (source_el.className=="menuitems"){
  193. source_el.id=(state=="on")? "mouseoverstyle" : ""
  194. }
  195. }
  196. }
  197. }
  198. //if (ie4||ns6)
  199. //document.onclick=hidemenu
  200. </script>
  201. <body bgcolor="#ffffff">
  202.  
  203.  
  204. <div style="left: 131px; top: 161px; visibility: hidden;" id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div>
  205.  
  206.  
  207.  
  208.  
  209.  
  210. <table border="0" cellpadding="0" cellspacing="0" width="800">
  211. <tbody><tr valign="top">
  212. <td colspan="1" width="468">
  213. <table class="table_buttons" border="0" cellpadding="0" cellspacing="0">
  214. <tbody><tr valign="top">
  215. <td class="td_buttons" title="Nasze programy" onclick='this.bgColor="F7941D";showmenu(event,linkset[0], 30, 20, 143)' onmouseout='this.bgColor="000000";delayhidemenu()' bgcolor="#000000">TEST1</td>
  216. </tr>
  217.  
  218. </body></html>


Mam takie cos smile.gif Tylko jak zrobic zeby sie chowało nie po wyjechaniu tylko po ponownym nacisnieciu przycisku questionmark.gif smile.gif