-
Notifications
You must be signed in to change notification settings - Fork 862
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
76 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,111 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" | ||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-touch-fullscreen" content="yes"> | ||
<title>top menu 测试</title> | ||
<link href="../assets/menu.css" rel="stylesheet"/> | ||
<link href="../assets/menuitem.css" rel="stylesheet"/> | ||
<link href="../assets/submenu.css" rel="stylesheet"/> | ||
<style> | ||
#menuTest { | ||
width: 300px; | ||
} | ||
|
||
.horizonal .ks-menuitem { | ||
float: left; | ||
width: 100px; | ||
overflow: hidden; | ||
} | ||
|
||
.horizonal { | ||
zoom: 1; | ||
overflow: hidden; | ||
} | ||
</style> | ||
<title>top menu 测试</title> | ||
<link href="../assets/menu.css" rel="stylesheet"/> | ||
<link href="../assets/menuitem.css" rel="stylesheet"/> | ||
<link href="../assets/submenu.css" rel="stylesheet"/> | ||
<style> | ||
#menuTest { | ||
width: 300px; | ||
} | ||
|
||
.horizonal .ks-menuitem { | ||
float: left; | ||
width: 100px; | ||
overflow: hidden; | ||
} | ||
|
||
.horizonal { | ||
zoom: 1; | ||
overflow: hidden; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1 style="text-align: center;"> | ||
顶部导航菜单 | ||
</h1> | ||
|
||
<div id="context" style="width: 500px;margin:50px auto;"> | ||
|
||
</div> | ||
<script src="/kissy/build/seed-debug.js"></script> | ||
<script src="/gen/dev.js"></script> | ||
<script> | ||
|
||
|
||
KISSY.use("menu,separator,node", function (S, Menu,Separator,$) { | ||
KISSY.use("menu,separator,node", function (S, Menu, Separator, $) { | ||
var context = $("#context"); | ||
|
||
var sb = new Menu.PopupMenu({ | ||
// boolean,是否鼠标脱离菜单后自动隐藏 | ||
autoHideOnMouseLeave:true, | ||
align:{ | ||
offset:[-1, 4], | ||
points:['bl', 'tl'] | ||
autoHideOnMouseLeave: true, | ||
align: { | ||
offset: [-1, 4], | ||
points: ['bl', 'tl'] | ||
} | ||
}); | ||
|
||
sb.addChild(new Menu.Item({ | ||
|
||
content:"submenuitem1"})); | ||
content: "submenuitem1"})); | ||
sb.addChild(new Menu.Item({ | ||
|
||
content:"submenuitem2"})); | ||
content: "submenuitem2"})); | ||
|
||
sb.addChild(new Separator()); | ||
|
||
var sb2 = new Menu.PopupMenu({ | ||
|
||
// boolean,是否鼠标脱离菜单后自动隐藏 | ||
autoHideOnMouseLeave:true, | ||
children:[ | ||
autoHideOnMouseLeave: true, | ||
children: [ | ||
new Menu.Item({ | ||
|
||
content:"submenuitem141"}) | ||
content: "submenuitem141"}) | ||
], | ||
// bug elStyle 无效 | ||
elStyle:{ | ||
color:"red" | ||
elStyle: { | ||
color: "red" | ||
} | ||
}); | ||
sb2.addChild(new Menu.Item({ | ||
|
||
content:"submenuitem22"})); | ||
content: "submenuitem22"})); | ||
|
||
var b2 = new Menu.SubMenu({ | ||
|
||
content:"sub-sub-menu", | ||
menu:sb2 | ||
content: "sub-sub-menu", | ||
menu: sb2 | ||
}); | ||
|
||
sb.addChild(b2); | ||
|
||
var b = new Menu.SubMenu({ | ||
content:"submenu", | ||
menu:sb | ||
content: "submenu", | ||
menu: sb | ||
}); | ||
|
||
var menu = new Menu({ | ||
|
||
width:440, | ||
render:'#context', | ||
elCls:"horizonal", | ||
children:[b, new Menu.Item({ | ||
|
||
content:"alone"})] | ||
width: 440, | ||
render: '#context', | ||
elCls: "horizonal", | ||
children: [b, | ||
new Menu.Item({ | ||
content: "alone" | ||
})] | ||
}); | ||
|
||
menu.render(); | ||
|
||
menu.on("click", function (e) { | ||
alert(e.target.get("content")); | ||
S.log(e.target.get("content")); | ||
}); | ||
}); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters