Log in

View Full Version : Flex Level Drop Down Menu - External Menu Content not working



CEWebsites
11-07-2013, 10:52 PM
Script: Flex Level Drop Down Menu
Script URL: http://www.dynamicdrive.com/dynamicindex1/flexdropdown.htm

The script works wonderfully when the menu contents are imbedded into the actual source code for the webpage. However, I cannot get the drop down menus to even appear when I place the menu contents into an external .js file as described in the instructions. I'm not sure if the problem lies with the flexdropdowncontents.js file I created or in the relating code on the source page or something else entirely. I've done all that I can think of and could use some help figuring this out.

Script imbedded in source code (Displays correctly)
http://www.fandetimesystems.com/TemplateTime4.html

Script using external .js file for Menu Contents (not displaying at all)
http://www.fandetimesystems.com/TemplateTime5.html

The external .js file is below
flexdropdowncontents.js

5270

Eppie A

jscheuer1
11-09-2013, 05:28 AM
The flexdropdowncontents.js file is OK, except that the lines are jumbled up. Some lines that need line breaks in them do not have them, others that can't have line breaks do. Here's a working version:


//1st MENU Contents

var flexmenu1=new ddlistmenu('flexmenu1', 'flexdropdownmenu') //var menuvar=new ddlistmenu('menuid', 'menuclass')
var subul1=flexmenu1.addItem('http://www.fandetimesystems.com/Biometrics.html', 'BIOMETRICS').addSubMenu()
subul1.addItem('http://www.fandetimesystems.com/FacialRec.html', 'FACIAL RECOGNITION')
subul1.addItem('http://www.fandetimesystems.com/FingerPrint.html', 'FINGER PRINT')
subul1.addItem('http://www.fandetimesystems.com/HandRead.html', 'HAND READERS')
//addItem(url, text, optionaltarget)
var subul2=flexmenu1.addItem('http://www.fandetimesystems.com/Software.html', 'SOFTWARE').addSubMenu()
subul2.addItem('http://www.fandetimesystems.com/Cloud.html', 'CLOUD BASED')
subul2.addItem('http://www.fandetimesystems.com/PCBased.html', 'PC BASED')
subul2.addItem('http://www.fandetimesystems.com/PrtSys.html', 'PORTABLE SYSTEMS')


var subul3=flexmenu1.addItem('http://www.fandetimesystems.com/Clocks.html', 'CLOCKS').addSubMenu() //create new 2nd level menu and assign it to new variable
subul3.addItem('http://www.fandetimesystems.com/ClockComupter.html', 'COMPUTERIZED')
subul3.addItem('http://www.fandetimesystems.com/ClockManual.html', 'MANUAL')
subul3.addItem('http://www.fandetimesystems.com/DataTerm.html', 'DATA TERMINALS')//2nd MENU Contents
var flexmenu2=new ddlistmenu('flexmenu2', 'flexdropdownmenu')
flexmenu2.addItem('http://www.fandetimesystems.com/CardPrint.html', 'CARD PRINTERS')
flexmenu2.addItem('http://www.fandetimesystems.com/GuardTour.html', 'GUARD TOUR')

Copy and paste the above to a new file and use it to replace the current flexdropdowncontents.js file you're using.

CEWebsites
11-09-2013, 03:48 PM
Thank You. That took care of it. Sometimes it's the obvious solution that stares us in the face and we need someone else to point it out to us. Again, many thanks.