DHTMLXTREE 树形菜单读取XML文件 实例 导航链接target解决方案

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

DHTMLXTREE树形菜单读取XML文件实例导航链接target解决方案.docjavascript分两部分:一、window.location.href解决target问题3个页面1index.htmlHtml代码1.!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01Frameset//EN=Content-Typecontent=text/html;charset=gb23125.title无标题文档/title6./head7.8.framesetrows=*cols=241,*framespacing=0frameborder=NOborder=09.framesrc=UntitledFrame-2.htmid=leftFramename=leftFramescrolling=NOnoresize10.framesrc=Untitled-1.htmid=rigthmainname=rigthmain11./frameset12.noframesbody13./body/noframes14./html2Untitled-1.htmHtml代码1.!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01Transitional//EN2.=Content-Typecontent=text/html;charset=gb23126.title无标题文档/title7./head8.9.body10.dasssssssssssssssssssssss11./body12./html3UntitledFrame-2.htmHtml代码1.!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01Transitional//EN2.=Content-Typecontent=text/html;charset=gb23126.title无标题文档/title7./head8.script9.functionaa(){10.window.parent.rigthmain.location.href=}12./script13.body14.aonClick=aa()a/a15./body16./html重点解析window.parent.rigthmain.location.href=取父框架rigthmain去子框架------------------------------------------------------------------------------------------------------------我实现的是读取xml文件在网页上以树形结构来显示。1、首先下载dhtmlxcommon.js和dhtmlxtree.js文件2、创建tree.xml?xmlversion=1.0encoding=UTF-8?treeid=0radio=1itemtext=AAid=p1im0=folderClosed.gifim1=folderOpen.gifim2=folderClosed.gifitemtext=AA_1id=wbtooltip='AA'im0=folderClosed.gifim1=folderOpen.gifim2=folderClosed.gifitemtext=AA_1_1tooltip='A'id=zlim0=leaf.gif!--设置节点的超链接--userdataname=url=AA_1_2tooltip='B'id=zyim0=leaf.gifuserdataname=url=AA_1_3tooltip='C'id=lyim0=leaf.gifuserdataname=url=AA_1_4tooltip='D'id=xqrim0=leaf.gifuserdataname=url=AA_1_5tooltip='R'id=wxlim0=leaf.gifuserdataname=url=BBid=p2im0=folderClosed.gifim1=folderOpen.gifim2=folderClosed.gifitemtext=BB_1id=prtooltip='BB'im0=folderClosed.gifim1=folderOpen.gifim2=folderClosed.gifitemtext=BB_1_1tooltip='A'id=clim0=leaf.gif/itemtext=BB_1_2tooltip='B'id=wsqim0=leaf.gif/itemtext=BB_1_3tooltip='C'id=wkim0=leaf.gif/itemtext=BB_1_4tooltip='D'id=stim0=leaf.gif/itemtext=BB_1_5tooltip='R'id=zqbim0=leaf.gif//item/item/tree3、创建mytree.html!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01Transitional//ENhtmlheadtitleMytree/titlescriptfunctionopenPathDocs(id){if(tree.getUserData(id,url)!=null){window.location.href=tree.getUserData(id,url);return;}}/script/headbodyscriptsrc=dhtmlxcommon.js/scriptscriptsrc=dhtmlxtree.js/scriptdivid=mytree/scripttree=newdhtmlXTreeObject(mytree,100%,100%,0);tree.setImagePath(images/);//设置单击节点的事件tree.setOnClickHandler(function(id){openPathDocs(id);});//设置节点可以拖动tree.enableDragAndDrop(1);//setplusimages设置收缩节点图标//tree.setImageArrays(plus,,,,plus.gif);//setminusimages设置展开节点图标//tree.setImageArrays(minus,,,,minus.gif);//设置节点之间的连接线和默认图标tree.enableTreeLines(true);tree.setXMLAutoLoading(tree.xml);tree.loadXML(tree.xml);/script/body/html4、由于图片等问件不能发,只好由你自己找喽,上网下18*18像素的就好哦!不加也可以的觉得有帮助就请给分吧,嘻嘻~

1 / 4
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功