Skip to content

Instantly share code, notes, and snippets.

@perlDreamer
Created October 23, 2009 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlDreamer/217038 to your computer and use it in GitHub Desktop.
Save perlDreamer/217038 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="http://mywebgui.localdomain/extras/yui/build/menu/assets/skins/sam/menu.css" rel="stylesheet" type="text/css" />
<script src="http://mywebgui.localdomain/extras/yui/build/utilities/utilities.js"></script>
<script src="http://mywebgui.localdomain/extras/yui/build/container/container.js"></script>
<script src="http://mywebgui.localdomain/extras/yui/build/menu/menu.js"></script>
<script type="text/javascript">
if ( typeof WebGUI == "undefined" ) {
WebGUI = {};
}
if ( typeof WebGUI.AssetManager == "undefined" ) {
WebGUI.AssetManager = {};
}
WebGUI.AssetManager.moreMenuToggle = function(e, menu) {
YAHOO.util.Event.stopEvent(e);
menu.show();
menu.focus();
}
WebGUI.AssetManager.initManager = function (o) {
var createdWrap = document.getElementById('createdWrap');
var created = document.createElement( 'a' );
createdWrap.appendChild(created);
created.appendChild(document.createTextNode('created'));
created.href = '#';
var createdMenu = new YAHOO.widget.Menu( "createdMenuId", {
"zindex" : 1000,
"clicktohide" : true,
"position" : "dynamic",
"context" : [ created, "tl", "bl" ],
"itemdata" : {
"one" : "#",
"two" : "#",
"three" : "#"
}
} );
YAHOO.util.Event.onDOMReady( function () { createdMenu.render( createdWrap ) } );
YAHOO.util.Event.addListener( created, "click", WebGUI.AssetManager.moreMenuToggle, createdMenu );
var existantWrap = document.getElementById('existantWrap');
var existant = document.getElementById('existantId');
var existantMenu = new YAHOO.widget.Menu( "createdMenuId", {
"zindex" : 1000,
"clicktohide" : true,
"position" : "dynamic",
"context" : [ created, "tl", "bl" ],
"itemdata" : {
"one" : "#",
"two" : "#",
"three" : "#"
}
} );
YAHOO.util.Event.onDOMReady( function () { existantMenu.render( existantWrap ) } );
YAHOO.util.Event.addListener( existant, "click", WebGUI.AssetManager.moreMenuToggle, existantMenu );
};
YAHOO.util.Event.onDOMReady( WebGUI.AssetManager.initManager );
</script>
<body>
<div class="yui-skin-sam" id="assetManager">
<div id="createdWrap"></div>
<div id="existantWrap"><a href="#" id="existantId">existant</a></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment