DHTML + Mozilla


  • xEPROMx
  • 1104 Aufrufe 3 Antworten

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • DHTML + Mozilla

    nabend zusammen ,

    habe mir über die tage ne kleine HP gebastelt .
    Leider musste ich nun feststellen das mein DHTML - Nagationsmenü(deep-tree)
    leider nicht auf Mozilla (auch Firefox) reagiert !
    :flag:
    Im IE 6.0 geht alles wunderbar .....

    weiß von euch jemand zufällig ne möglichkeit ,
    das ich die navigation auch mit Mozilla sehen kann?

    habe das ganze momentan noch lokal aufm rechner ....deshalb kein link!
    EDIT : htt*://eprom.dyn.ee <-nicht immer Online !!!!
    hier der Coode:

    HTML-Quellcode

    1. --
    2. '*********************************************************************************
    3. ' COMobjects.NET Deep Tree Script(c) Fedor Skvortsov, COMobjects.NET. November, 2001
    4. ' Mailto: [email]fed@comobjects.net[/email]
    5. ' WWW: [url]http://comobjects.net[/url]
    6. '*********************************************************************************
    7. -->
    8. <html>
    9. <head>
    10. <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    11. <style type="text/css">
    12. a
    13. {
    14. color: #003399;
    15. text-decoration: none;
    16. }
    17. a:hover
    18. {
    19. color: red;
    20. text-decoration: none;
    21. }
    22. .load
    23. {
    24. font-size: 11px;
    25. background-color:infobackground;
    26. border-width:1px;
    27. border-color:black;
    28. border-style:solid;
    29. width:10px;
    30. }
    31. LI
    32. {
    33. margin-left:-25px;
    34. list-style-type:none;
    35. list-style-image:none;
    36. font-family:verdana;
    37. font-size:8pt;
    38. }
    39. .treenode
    40. {
    41. margin-left:3px;
    42. font-size: 8pt;
    43. border-width:1px;
    44. border-color:White;
    45. border-style:solid;
    46. }
    47. .treenodesel
    48. {
    49. font-size: 8pt;
    50. margin-left: 3px;
    51. border-width:1px;
    52. border-color:Navy;
    53. border-style:solid;
    54. }
    55. .treenodeover {
    56. margin-left:3px;
    57. font-size: 8pt;
    58. border-width:1px;
    59. border-color:White;
    60. border-style:solid;
    61. }
    62. .treenodeselover
    63. {
    64. font-size: 8pt;
    65. margin-left: 3px;
    66. border-width:1px;
    67. border-color:Blue;
    68. border-style:solid;
    69. }
    70. </style>
    71. <script language="jscript">
    72. //Root Tree
    73. var sRootTree = "TOC/Root.xml"
    74. //Images
    75. var sImagesPath = "Images/";
    76. var sImageNone = sImagesPath + "none.gif";
    77. var sImagePlus = sImagesPath + "plus.gif";
    78. var sImageMinus = sImagesPath + "minus.gif";
    79. //Styles
    80. var sNodeLoadingClass = "load";
    81. var sNodeClass = "treenode";
    82. var sNodeOverClass = "treenodeover";
    83. var sNodeSelClass = "treenodesel"
    84. var sNodeSelOverClass = "treenodeselover"
    85. //Text
    86. var sCancelLoad = "Loading...";
    87. //XML Document which contains tree
    88. var oXML;
    89. //Base href for current loading node
    90. var sBaseHref;
    91. //Selected node
    92. var oSelNode;
    93. //Curent loading node. Only one node can be being loading at one moment!*/
    94. var loadingNode;
    95. //Show loading node [Loading...]
    96. function showLoadingNode(Node){
    97. var oDiv;
    98. oDIV = document.createElement("<div>");
    99. oDIV.className = sNodeLoadingClass;
    100. oDIV = Node.appendChild(oDIV);
    101. oDIV.innerText = sCancelLoad;
    102. oDIV.onclick = cancelLoad;
    103. }
    104. //Hide loading node
    105. function hideLoadingNode(Node){
    106. try{
    107. if (Node.childNodes.length>1){
    108. oDIV = Node.childNodes(1);
    109. Node.removeChild(oDIV);
    110. }
    111. }
    112. catch(x){}
    113. }
    114. //This function builds tree.
    115. //Parameter sourceNode is a XML source node, resultNode is a produced HTML node,
    116. //expanded specifies whether display resultNode expanded or not.
    117. function buildTree(sourceNode, resultNode, expanded){
    118. var oLI, oUL, oIMG, oA, oNOBR, i, oNodeAttributes;
    119. var sIcon, sName, sHref, sTarget, sSrc;
    120. //Create container for child nodes
    121. oUL = document.createElement("<ul>");
    122. oUL = resultNode.appendChild(oUL);
    123. //if node expanded then display container
    124. if (expanded=="true"){
    125. oUL.style.display="block";
    126. }
    127. else{
    128. oUL.style.display="none";
    129. }
    130. //Run over nodes in XML source
    131. for (i=0;i<sourceNode.childNodes.length;i++){
    132. //Set obligatory values
    133. oNodeAttributes = sourceNode.childNodes(i).attributes;
    134. sIcon = oNodeAttributes.getNamedItem("icon").value;
    135. sName = oNodeAttributes.getNamedItem("name").value;
    136. //Set optional values
    137. if (oNodeAttributes.getNamedItem("href")!= null){
    138. sHref = oNodeAttributes.getNamedItem("href").value;
    139. }
    140. else{
    141. sHref = "";
    142. }
    143. if (oNodeAttributes.getNamedItem("target")!=null){
    144. sTarget = oNodeAttributes.getNamedItem("target").value;
    145. }
    146. else{
    147. sTarget = ""
    148. }
    149. //Create node
    150. oLI = document.createElement("<li>");
    151. oLI = oUL.appendChild(oLI);
    152. oNOBR = document.createElement("<nobr>");
    153. oNOBR = oLI.appendChild(oNOBR);
    154. //Create action image
    155. oIMG = document.createElement("<img>");
    156. oIMG.border = 0;
    157. //If src attribute is not empty, add custom attribute to the result node
    158. if (oNodeAttributes.getNamedItem("src")!=null){
    159. sSrc = oNodeAttributes.getNamedItem("src").value;
    160. }
    161. else{
    162. sSrc = "";
    163. }
    164. oLI.setAttribute("src", sSrc);
    165. //If src attribute is not empty or amount of the child nodes is not equals zero
    166. if (sSrc!="" || sourceNode.childNodes(i).childNodes.length>0){
    167. //If sub nodes was not loaded
    168. if (sSrc!=""){
    169. oLI.setAttribute("LoadedChildren", "false");
    170. }
    171. //If sub nodes are already loaded
    172. else{
    173. oLI.setAttribute("LoadedChildren", "true");
    174. }
    175. oIMG.src = sImagePlus;
    176. oLI.setAttribute("Expanded", "false");
    177. //Set action image event handler
    178. oIMG.onclick = actionOnClick;
    179. }
    180. else{
    181. oIMG.src = sImageNone;
    182. }
    183. //Create icon image
    184. oIMG = oNOBR.appendChild(oIMG);
    185. oIMG = document.createElement("<img>");
    186. oIMG.border = 0;
    187. oIMG.src = sImagesPath + sIcon + ".gif";
    188. oIMG = oNOBR.appendChild(oIMG);
    189. oA = document.createElement("<a>");
    190. if (sHref!=""){
    191. oA.href = sBaseHref + sHref;
    192. //Set event handler for node
    193. oA.onclick = nodeOnClick;
    194. oA.onmouseover = nodeOnMouseOver;
    195. oA.onmouseout = nodeOnMouseOut;
    196. }
    197. if (sTarget!=""){
    198. oA.target = sTarget;
    199. }
    200. oA.innerText = sName;
    201. oA.title = sName;
    202. oA.className = "treenode";
    203. oA = oNOBR.appendChild(oA);
    204. if (sourceNode.childNodes(i).childNodes.length>0)
    205. {
    206. //Assembly subtree
    207. buildTree(sourceNode.childNodes(i), oLI, "false")
    208. }
    209. }
    210. //Add custom attributes to resultNode which specifies whether node loaded children or not and
    211. //whether is was expanded or not
    212. resultNode.setAttribute("LoadedChildren", "true")
    213. resultNode.setAttribute ("Expanded", expanded);
    214. }
    215. //ÍÀ×ÈÍÀÉ ÏÐÎÂÅÐßÒÜ ÇÄÅÑÜ, ÍÅ ÇÀÁÓÄÜ ÓÄÀËÈÒÜ
    216. //This function handle OnClick event on action image
    217. //ÊÎÍ×ÀÉ ÏÐÎÂÅÐßÒÜ ÇÄÅÑÜ, ÍÅ ÇÀÁÓÄÜ ÓÄÀËÈÒÜ
    218. function actionOnClick(){
    219. var oNode
    220. oNode = event.srcElement;
    221. event.cancelBubble = true;
    222. //If node is already expanded we collapse it
    223. if (oNode.parentNode.parentNode.getAttribute ("Expanded")=="true"){
    224. oNode.parentNode.parentNode.childNodes(1).style.display = "none";
    225. oNode.parentNode.parentNode.childNodes(0).childNodes(0).src = sImagePlus;
    226. oNode.parentNode.parentNode.setAttribute ("Expanded", "false")
    227. }
    228. //If node is collapsed expand it
    229. else{
    230. //If children nodes are already loaded, just expand it
    231. if (oNode.parentNode.parentNode.getAttribute("LoadedChildren")=="true"){
    232. oNode.parentNode.parentNode.childNodes(1).style.display = "block";
    233. oNode.parentNode.parentNode.childNodes(0).childNodes(0).src = sImageMinus;
    234. oNode.parentNode.parentNode.setAttribute ("Expanded", "true")
    235. }
    236. //Children nodes are not loaded yet, we need to load it
    237. else{
    238. //If the other nodes are loaded at the current time, we should stop it
    239. if (loadingNode!=null){
    240. hideLoadingNode(loadingNode);
    241. }
    242. //Set new node
    243. loadingNode = oNode.parentNode.parentNode;
    244. //Show loading node
    245. showLoadingNode(loadingNode);
    246. //Assembly subtree
    247. oXml.load(loadingNode.getAttribute("src"));
    248. }
    249. }
    250. }
    251. //This function handles OnClick event on link
    252. function nodeOnClick(){
    253. var oNode
    254. oNode = event.srcElement;
    255. event.cancelBubble = true;
    256. if (oSelNode!=null)
    257. {
    258. oSelNode.childNodes(0).childNodes(2).className = sNodeClass;
    259. }
    260. oSelNode = oNode.parentNode.parentNode;
    261. oSelNode.childNodes(0).childNodes(2).className = sNodeSelOverClass;
    262. //Add your code to handle this event
    263. }
    264. //This function handles OnMouseOver event on link
    265. function nodeOnMouseOver(){
    266. var oNode
    267. oNode = event.srcElement;
    268. event.cancelBubble = true;
    269. window.status = oNode.innerText;
    270. if (oNode.className==sNodeSelClass){
    271. oNode.className = sNodeSelOverClass;
    272. }
    273. else{
    274. oNode.className = sNodeOverClass;
    275. }
    276. //Add your code to handle this event
    277. }
    278. //This function handles OnMouseOut event on link
    279. function nodeOnMouseOut(){
    280. var oNode
    281. oNode = event.srcElement;
    282. event.cancelBubble = true;
    283. window.status = "";
    284. if (oNode.className==sNodeSelOverClass){
    285. oNode.className = sNodeSelClass;
    286. }
    287. else{
    288. oNode.className = sNodeClass;
    289. }
    290. //Add your code to handle this event
    291. }
    292. //This function handles OnClick event on loading node
    293. function cancelLoad(){
    294. var oNode
    295. oNode = event.srcElement;
    296. hideLoadingNode(oNode.parentElement);
    297. loadingNode = null;
    298. }
    299. function initPage(){
    300. oSelNode = null;
    301. //set loadingNode to the tree container
    302. loadingNode = document.all("Tree");
    303. oXml = new ActiveXObject("Microsoft.XMLDOM");
    304. //Change this property to false if you are working in synchronous mode
    305. oXml.async = true;
    306. //set handler for xml data loading event
    307. oXml.onreadystatechange = onLoadXml;
    308. //load root xml data source
    309. oXml.load(sRootTree);
    310. }
    311. //This function parses and builds tree when XML data source has been loaded
    312. function onLoadXml(){
    313. //test if xml was fully loaded (COMPLETED(4))
    314. if (oXml.readyState==4){
    315. hideLoadingNode (loadingNode);
    316. //test if xml is well formed and contains other than documentElement nodes
    317. if ((oXml.parseError.reason=="") && (oXml.documentElement.childNodes.length>0)){
    318. if (loadingNode!=document.all("Tree")){
    319. loadingNode.childNodes(0).childNodes(0).src = sImageMinus;
    320. }
    321. //Set sBaseHref which specifies the baseline URL
    322. sBaseHref = oXml.documentElement.attributes.getNamedItem("base").value;
    323. //Building treeview starts with documentElement of XML and loading node
    324. //We expand only one level of deep treeview, so we just pass "true" value in this call
    325. buildTree(oXml.documentElement, loadingNode, "true");
    326. }
    327. else
    328. {
    329. //If subtree loading have been failed, change action image to none and remove event handler
    330. loadingNode.childNodes(0).childNodes(0).src = sImageNone;
    331. loadingNode.childNodes(0).childNodes(0).onclick = null;
    332. }
    333. //Actions with loading node are finished, so set it to null
    334. loadingNode = null;
    335. }
    336. }
    337. </script>
    338. <base target="Hauptframe">
    339. </head>
    340. <body onload="initPage();" bgcolor="#FFFFFF">
    341. <div id="Tree" style="margin-left:-20px;">
    342. </div>
    343. </body>
    344. </html>
    Alles anzeigen
    PROFIL
    LAST UPLOADS:
    ZAPPING,
    BABY BOY,KOPS,Musical Mixxor

    bin bis 5.12 unterwegs........