• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Pop-up menus in Templates

On 10/30/2002, a question was asked about why pop-up menus couldn't be added to templates.
http://www.experts-exchange.com/Web/WebDevSoftware/DreamWeaver/Q_20386303.html?query=%22pop-up+menu%22&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
http://www.experts-exchange.com/Web/WebDevSoftware/DreamWeaver/Q_20978040.html?query=%22pop-up+menu%22&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.

0
psenn
Asked:
psenn
  • 2
  • 2
1 Solution
 
alexhoganCommented:
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.
0
 
psennAuthor Commented:
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?
0
 
alexhoganCommented:
I'd do it in javascript and css.
0
 
psennAuthor Commented:
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now