Results 1 to 5 of 5

Thread: AnyLink DropDown Menu

  1. #1
    Join Date
    May 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default AnyLink DropDown Menu

    1) Script Title:

    AnyLink DropDown Menu

    2) Script URL (on DD):

    http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem:

    http://personalpages.tds.net/~dlt.tt...site/test.html

    The above is a testing page for a site I am doing for a friend. The script in question is being used on the CONTACT link. Where it says Mailing Address, is it possible to do an onClick open browser window?

    I have tried the following, with no luck...

    <a href="#" onClick="MM_openBrWindow('address.html','','width=160,height=160')">

  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

    I think you are talking about where, at the moment, you have this:

    Code:
    menu5[1]='<a href="#">Mailing Address</a>'
    Since you are using ' to delimit the link string, if you use ' inside it, you must escape it:

    Code:
    menu5[1]='<a href="#" onclick="MM_openBrWindow(\'address.html\',\'\',\'width=160,height=160\');return false;">Mailing Address</a>'
    And you should return false if you don't want the default link behavior ("#" in this case, which reloads to the top of the page in many browsers).

    You could also do it like so:

    Code:
    menu5[1]="<a href=\"#\" onclick=\"MM_openBrWindow('address.html','','width=160,height=160');return false;\">Mailing Address</a>"
    which is a little easier on the eye.
    - John
    ________________________

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

  3. #3
    Join Date
    May 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Cheers, mate...

    One problem fixed. Whereas what I did caused the entire script to not work, what you suggested does not.

    But when I click on Mailing Address, nothing happens.

  4. #4
    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

    I don't see that you've changed anything on your test page. And even when you do:

    MM_openBrWindow()

    won't do anything if it isn't valid and available to the page.

    You could try it with the native window.open():

    Code:
    menu5[1]="<a href=\"#\" onclick=\"window.open('address.html','','width=160,height=160');return false;\">Mailing Address</a>"
    - John
    ________________________

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

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    VprDmnd (05-13-2008)

  6. #5
    Join Date
    May 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Great, window.open() worked perfectly.

    Thanks a ton, man...

    BTW, yeah, I had changed it but forgot to upload it to the web server...

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
  •