Results 1 to 3 of 3

Thread: AnyLink Drop Down Menu - link to new window of specified size

  1. #1
    Join Date
    Jul 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AnyLink Drop Down Menu - link to new window of specified size

    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!

    Andy

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Andy
    Code:
    <a href=""onClick
    That 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:
    Code:
    //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:
    Code:
    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>'
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That's brilliant!
    Thanks - Andy

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •