<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>带右键菜单的目录树</TITLE>
<META http-equiv=content-type content="text/html; charset=utf-8">
<META content=Samples name=title>
<META content="" name=keywords>
<META content="" name=description>
<LINK media=screen href="js/style.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.3790.4696" name=GENERATOR>
<!-- menu start -->
<LINK media=screen href="proto.menu.0.6.css"
type=text/css rel=stylesheet>
<STYLE type=text/css>BODY {
MARGIN: 0px; HEIGHT: 100%
}
</STYLE>
<SCRIPT src="js/prototype_trunk.js" type=text/javascript></SCRIPT>
<SCRIPT src="js/proto.menu.0.6.js" type=text/javascript></SCRIPT>
<SCRIPT type=text/javascript>
Element.addMethods({
getNumStyle: function(element, style) {
var value = $(element).getStyle(style);
return value === null ? null : parseInt(value);
}
})
var myMenuItems = [
{
name: '查看节点信息',
className: 'new',
callback: function(e) {
var tagName = e.element().tagName.toLowerCase(),
x = e.screenX,
y = e.screenY;
alert("你查看的节点信息为:"+tree.getItemText(g_id));
}
},{
separator: true
},{
group:1,
name: '查看班级信息(根节点)',
className: 'edit',
callback: function() {
alert('全选');
}
},{
group:2,
name: '查看学生信息(叶节点)',
className: 'copy',
callback: function() {
alert('Copy function called');
}
},{
name: '添加新学生(叶节点)',
group:2,
disabled: true,
className: 'delete'
} ,{
name: 'save',
className: 'save',
callback: function() {
alert('Saving...');
}
},{
separator: true
},{
name: 'Save as .xsl',
className: 'xsl',
callback: function() {
alert('Saving as .xsl');
}
},{
name: 'Save as .doc',
className: 'doc',
callback: function() {
alert('Saving as .doc');
}
},{
name: 'Save as .pdf',
className: 'pdf',
callback: function() {
alert('Saving as .pdf');
}
},{
separator: true
},{
name: 'Send to...',
disabled: true,
className: 'send'
}
]
document.observe('dom:loaded', function(){
new Proto.Menu({
selector: '#treeboxbox_tree',
className: 'menu desktop',
menuItems: myMenuItems
})
})
</SCRIPT>
<!-- menu end-->
</HEAD>
<BODY>
<LINK href="js/dhtmlxtree.css" type=text/css rel=STYLESHEET>
<SCRIPT src="js/dhtmlxcommon.js"></SCRIPT>
<SCRIPT src="js/dhtmlxtree.js"></SCRIPT>
<DIV id=treeboxbox_tree style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: silver 1px solid; BORDER-LEFT: silver 1px solid; WIDTH: 250px; height:300px; BORDER-BOTTOM: silver 1px solid; BACKGROUND-COLOR: #f5f5f5"></DIV>
<SCRIPT>
var inTree=false;
var g_id="";
var state =0; //0 表示叶子节点 其他表示根目录
function doLog(str){
//var log = document.getElementById("msg");
// log.innerHTML = log.innerHTML+str+"<br/>"
// log.scrollTop = log.scrollHeight;
}
function tonclick(id){
doLog("Item "+tree.getItemText(id)+" was selected");
};
function tondblclick(id){
doLog("Item "+tree.getItemText(id)+" was doubleclicked");
state = tree.getOpenState(id);
};
function tondrag(id,id2){
return confirm("Do you want to move node "+tree.getItemText(id)+" to item "+tree.getItemText(id2)+"?");
};
function tonopen(id,mode){
return confirm("Do you want to "+(mode>0?"close":"open")+" node "+tree.getItemText(id)+"?");
};
function toncheck(id,state){
doLog("Item "+tree.getItemText(id)+" was " +((state)?"checked":"unchecked"));
};
function tonMIn(id){
g_id=id;
tree.selectItem(id);
inTree=true;
state = tree.getOpenState(id);
// msg.innerHTML="tonMIn";
};
function tonMOut(id){
inTree=false;
// msg.innerHTML="tonMOut";
};
function tonRightClick(id,state){
//tree.selectItem(id);
};
tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
tree.setSkin('dhx_skyblue');
tree.setImagePath("images/tree/csh_bluebooks/");
//tree.enableCheckBoxes(1);
//tree.enableDragAndDrop(1);
//tree.setOnOpenHandler(tonopen);
//tree.attachEvent("onOpenEnd",function(nodeId, event){doLog("An id of open item is "+nodeId);});
//tree.setOnClickHandler(tonclick);
tree.setOnCheckHandler(toncheck);
tree.setOnDblClickHandler(tondblclick);
tree.setDragHandler(tondrag);
tree.setOnMouseInHandler(tonMIn);
tree.setOnMouseOutHandler(tonMOut);
//tree.setOnRightClickHandler(tonRightClick);
tree.loadXML("tree3.xml");
</SCRIPT>
<br>
<div id="msg" ></div>
<script>
function setGroupMenu(m_state)
{
//m_state =0 表示叶子节点 其他表示 根节点
if(m_state==0)
{
//叶子节点
groupName="2";
}else
{
//根节点
groupName="1";
}
var items=document.getElementsByTagName("LI");
for(var i=0;i<items.length;i++)
{
if(items[i].className!="separator")
{
if(items[i].group==""||items[i].group==groupName)
{
items[i].className="";
}else
{
items[i].className="none";
}
}
}
}
function getElementsByClassName(className,tagName){
var items=document.getElementsByTagName(tagName);
for(var i=0;i<items.length;i++)
{
if(items[i].className==className)
{
return items[i];
}
}
}
</script>
</BODY></HTML>
没有合适的资源?快使用搜索试试~ 我知道了~
JS 带右键菜单的目录树 dhtmlxtree+proto.menu 分权限
共387个文件
gif:354个
scc:11个
png:10个
4星 · 超过85%的资源 需积分: 9 41 下载量 69 浏览量
2010-08-12
17:16:33
上传
评论 3
收藏 159KB RAR 举报
温馨提示
JS 带右键菜单的目录树 dhtmlxtree+proto.menu 分权限 JS 带右键菜单的目录树 dhtmlxtree+proto.menu 分权限 图片预览 http://dl.javaeye.com/upload/attachment/292122/0416949a-cc61-3ae1-bf89-ce81b5d743ab.jpg
资源推荐
资源详情
资源评论
收起资源包目录
JS 带右键菜单的目录树 dhtmlxtree+proto.menu 分权限 (387个子文件)
style.css 8KB
dhtmlxtree.css 6KB
proto.menu.0.6.css 3KB
Thumbs.db 12KB
close2.gif 1KB
iconSound.gif 639B
iconWrite2.gif 635B
iconWrite1.gif 630B
iconFlag.gif 623B
iconTexts.gif 622B
file.gif 622B
iconChecked.gif 615B
leaf.gif 614B
iconText.gif 613B
iconGraph.gif 608B
radio_on.gif 361B
iconCheckAll.gif 342B
iconCheckDis.gif 342B
iconCheckGray.gif 342B
folderOpen.gif 341B
source.gif 333B
iconSound.gif 305B
folderClosed.gif 284B
folderClosed.gif 284B
leaf3.gif 284B
leaf_2.gif 284B
books_close.gif 284B
leaf.gif 284B
iconSound.gif 283B
iconChecked.gif 281B
iconCheckGray.gif 279B
iconUncheckAll.gif 279B
iconCheckGray.gif 279B
iconUncheckAll.gif 279B
iconUncheckAll.gif 279B
iconCheckGray.gif 279B
iconCheckGray.gif 279B
iconUncheckAll.gif 279B
iconUncheckAll.gif 279B
iconCheckGray.gif 279B
iconCheckGray.gif 279B
iconUncheckAll.gif 279B
iconWrite1.gif 278B
folderOpen.gif 277B
iconWrite1.gif 276B
iconCheckAll.gif 275B
iconCheckAll.gif 275B
iconCheckAll.gif 275B
iconCheckAll.gif 275B
iconWrite1.gif 275B
iconCheckAll.gif 275B
iconCheckAll.gif 275B
iconGraph.gif 274B
iconCheckAll_2.gif 273B
folderOpen.gif 273B
iconWrite2.gif 272B
iconCheckDis.gif 270B
iconWrite2.gif 270B
iconCheckDis.gif 270B
iconWrite1.gif 270B
iconWrite2.gif 270B
iconCheckDis.gif 270B
iconCheckDis.gif 270B
iconWrite2.gif 270B
iconCheckDis.gif 270B
iconCheckDis.gif 270B
iconFlag.gif 269B
iconUncheckDis.gif 268B
iconFlag.gif 268B
iconUncheckDis.gif 268B
iconUncheckDis.gif 268B
iconUncheckDis.gif 268B
iconUncheckDis.gif 268B
iconUncheckDis.gif 268B
folderOpen.gif 266B
iconGraph.gif 263B
folderClosed.gif 261B
tombs_open.gif 261B
safe_open.gif 261B
iconSafe.gif 261B
tree.gif 261B
book.gif 260B
leaf.gif 260B
tombs.gif 259B
safe_close.gif 259B
iconChecked.gif 257B
iconChecked.gif 257B
folderOpen.gif 257B
iconChecked.gif 257B
iconChecked.gif 257B
iconTexts.gif 256B
folderOpen.gif 252B
radio_on.gif 251B
radio_on.gif 251B
leaf.gif 251B
radio_on.gif 251B
radio_on.gif 251B
radio_on.gif 251B
radio_on.gif 251B
radio_on.gif 251B
共 387 条
- 1
- 2
- 3
- 4
资源评论
- 大猫会长2013-04-29效果不错,盖起来有点麻烦
bdk82924
- 粉丝: 0
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于Spring Boot和Vue的后台管理系统.zip
- 用于将 Power BI 嵌入到您的应用中的 JavaScript 库 查看文档网站和 Wiki 了解更多信息 .zip
- (源码)基于Arduino、Python和Web技术的太阳能监控数据管理系统.zip
- (源码)基于Arduino的CAN总线传感器与执行器通信系统.zip
- (源码)基于C++的智能电力系统通信协议实现.zip
- 用于 Java 的 JSON-RPC.zip
- 用 JavaScript 重新实现计算机科学.zip
- (源码)基于PythonOpenCVYOLOv5DeepSort的猕猴桃自动计数系统.zip
- 用 JavaScript 编写的贪吃蛇游戏 .zip
- (源码)基于ASP.NET Core的美术课程管理系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功