Link to home
Start Free TrialLog in
Avatar of psenn
psenn

asked on

Pop-up menus in Templates

On 10/30/2002, a question was asked about why pop-up menus couldn't be added to templates.
https://www.experts-exchange.com/questions/20386303/Template-and-show-pop-up-menu.html?query="pop-up+menu"&topics=114
The answer was because pop-ups are stored in the head section of a document, and templates lock the head section.

But at this PAQ
https://www.experts-exchange.com/questions/20978040/How-to-create-bread-crumps-type-of-menus.html?query="pop-up+menu"&topics=114
someone mentioned that they "export the javascript to another file and call (link) it in my template page".

Q: How do you call (link) javascript code to a template?
Is is done with a cfinclude?
I'd like to add a pop-up menu to my template.

Avatar of alexhogan
alexhogan

To link a js file (external javascript file) you call it like a css file.

In the <head> tag place this;
<script type="text/javascript" src="myjavascript.js"></script>

You can also link the file with an include statement...
<cfinclude template=myjavascript.js>

I'm unsure on wether or not there are quotes in the cf tag.  It's been a long time since I've used cf.  Also you might have to put the javascript in <script> tags and embed them in another cfm file.  Not sure about that.
Avatar of psenn

ASKER

Alex,

Thanks for the reply.  I've been experimenting with CSS flyouts such as "Deluxe CSS dropdowns and flyouts" found at
http://www.positioniseverything.net/css-dropdowns.html
so I might not use the "Show pop-up menu" feature that's built into DW.

Here's some other links:
http://www.communitymx.com/content/article.cfm?cid=55A69
http://www.howtocreate.co.uk/tutorials/testMenu.html

I haven't gotten it quite down yet.
The problem with CSS flyouts is they require a bit of tweeking to get them to work (csshover.htc is required for IE browser to work).

What am I missing?  All I want to do is put a pop-out (dropdown, flyout) menu on my template (*.dwt file).
If you wanted to put a pop-out menu on your website, how would you do it?
ASKER CERTIFIED SOLUTION
Avatar of alexhogan
alexhogan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of psenn

ASKER

Here's how I did it using javascript and css:
http://www.ifh.com/BETA/STYLES/flyout1-demo.html
Take a look and tell me what you think.

The only problem is I had to include the following to get it to work:
<!--[if IE]>
      <style type="text/css">
        body {behavior: url(csshover.htc);}
     
I guess I don't have much to complain about since it works, but I'm just looking for the cleanest implementation of css pop-out menus, and I'm not too keen on including csshover.htc.