View Full Version : AnyLink Drop Down Menu - link to new window of specified size

07-11-2005, 09:33 AM
This script looks really useful.

One problem I'm having - and I'm very much a newbie at this!
I want to link to "internal" website files and open them in
a window of specified size etc.
The link code I use for this is normally something like

<a href=""onClick="window.open('filename.htm','newWnd','width=500,height=400,left=80,top=80,menubar=no,location=no,scrollbars=no,toolbar=no');return false;">filename</a>

AnyLink Drop Down Menu seems to object to this.
Any ideas how the offending link could be amended
or any ideas about a different way of achieving the
same effect which will work with AnyLink Drop Down Menu?

Ideally I would like to have the possibility of varying the
size of the new window for individual links. But that
may be asking too much!


07-11-2005, 10:05 AM
<a href=""onClickThat could throw it off even in regular html, I think. If you are putting this in a links array in the script, you have to escape the type of quote used to delimit the entry with a down (\) slash when it is used in the entry's content. Like if you are putting it into this sort of thing:

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.javascriptkit.com">JavaScript Kit</a>'
menu1[1]='<a href="http://www.freewarejava.com">Freewarejava.com</a>'
menu1[2]='<a href="http://codingforums.com">Coding Forums</a>'
menu1[3]='<a href="http://www.cssdrive.com">CSS Drive</a>'The single quotes in your entry must be escaped. Like:

menu1[0]='<a href="#" onClick="window.open(\'filename.htm\',\'newWnd\',\'width=500,height=400,left=80,top=80,menubar=no,location=no,scrollbars=no,toolbar=no\');return false;">filename</a>'

07-11-2005, 10:43 AM
That's brilliant!
Thanks - Andy