JavaScript Drop Down Menu : Popup Menu : GUI Components : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP


JavaScript DHTML  »  GUI Components   » [  Popup Menu  ]   
 



JavaScript Drop Down Menu


<html>
<head>
<title>DynAPI Examples - HTML Drop Down Menu</title>
<script language="JavaScript" src="./dynapisrc/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('./dynapisrc/');
dynapi.library.include('dynapi.api');
dynapi.library.include('TemplateManager');
dynapi.library.include('HTMLDropDownMenu');
dynapi.library.include('HTMLButton');
</script>
<script language="Javascript">

var o={
  'http://www.sourceforge.net':'SourceForge.net',
  'http://dynapi.sourceforge.net':'DynAPI',
  'http://javascript.internet.com':'JavaScript Source',
  'http://www.w3c.org':'The World Wide Web Consortium (W3C)',
  'http://www.linux.org':'The Linux Home Page',
  'http://www.javascript-games.org/':'Javascript Games!',
  'http://www.dannyg.com/pubs/jsb/index.html':'JavaScript Bible Series'
};

var t = 'This is the Template:<center><form><table border="0" width="310"><tr><td colspan="3">Select a website:<br>{@ddm} {@btnGo}</td></tr></table></form></center>';
var tp = new Template(t,100,100,350,200,'#EEEEEE');
tp.addChild(new HTMLButton(null,' > ','Click here to view site'),'btnGo');
tp.addChild(new HTMLDropDownMenu(null,o),'ddm');
tp.btnGo.addEventListener({
  onclick:function(e){
    alert(tp.ddm.getSelected());
  }
});

dynapi.document.addChild(tp);

</script>
</head>
<body>
<script>
  dynapi.document.insertAllChildren();
</script>
</body>
</html>

           
       
Download: dynapi.zip   ( 791  K )  
Related examples in the same category
1.  Context Menu ExampleHas Download File
























Home| Contact Us
Copyright 2003 - 07 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.