PDA

View Full Version : AnyLink JS Drop Down Menu and DHTML Window widget



rushhh
03-30-2009, 10:44 PM
Hi I'm using the AnyLink JS Drop Down Menu and have one of items in the list to open DHTML Window widget

AnyLink JS Drop Down Menu:
http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

DHTML Window widget:
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm


Here what I have so far, but it isn't working.
Test.htm:


<html>
<head>
<link rel="stylesheet" href="css/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="js/dhtmlwindow.js"></script>
<script type="text/javascript" src="js/anylinkmenu.js"></script>
<script type="text/javascript" src="js/menucontents.js"></script>
<script type="text/javascript">
function openmypage(){ //Define arbitrary function to run desired DHTML Window widget codes
ajaxwin=dhtmlwindow.open("ajaxbox", "iframe", "Item2.htm", "Quick View", "width=575px,height=150px,left=150px,top=100px,resize=1,scrolling=1")
}
</script>
</head>
<body>
<a href="http://www.dynamicdrive.com" class="menuanchorclass" rel="anylinkmenu1">Menu</a>
<script type="text/javascript">
anylinkmenu.init("menuanchorclass")
</script>
</body>
</html>


menucontents.js


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "anylinkmenu1" is a unique name!
anylinkmenu1.items=[
["Item1", "Item1.htm"],
["Item2", "Item2.htm,onclick="openmypage(); return false""],

]

I'm sure I have something wrong with the line of Item2.
Has anybody seen a question like this on this forum before? or know what I could do ?

Thanks

ddadmin
03-31-2009, 06:27 AM
Instead of:


["Item2", "Item2.htm,onclick="openmypage(); return false""],

Try something like:


["Item2", "javascript:openmypage()"],

rushhh
03-31-2009, 07:52 AM
Thanks so much that works. :)