Results 1 to 9 of 9

Thread: Updating dropdown.js in AnyLink Drop Down Menu

  1. #1
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Updating dropdown.js in AnyLink Drop Down Menu

    1) Script Title: AnyLink Drop Down Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem: My (fairly ancient) version does not work well on some mobiles. The menu fails to close when clicking elsewhere on page.

    I was looking for an update, which I found - item 2) above. However it seems to employ a different approach. My version has all the link information in the file dropdown.js but I cannot see that file here. Does an updated version of that file exist somewhere? Or do I have to re-do everything?

    Peter

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    In the new version, the menu contents is defined in a separate .js file called menucontents.js (see script page). Otherwise the implementation should be fairly similar to the original.
    DD Admin

  3. #3
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks.

    I see menucontents.js is in different format from dropdown.js which was:
    var menu1=new Array()
    j=0;
    menu1[j++]='<a href="http://www.peterrussell.com/php">Home Page</a>'
    etc

    Was hoping to be able to keep previous format and save work. Oh well...

    Peter

  4. #4
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So I re-did the data for all the files. It is all working OK, except that I still have same problem on mobile (iPhone 6Plus - Safari and Chrome) - menu does not hide when I click elsewhere on screen.

  5. #5
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Works OK on a stripped down page, so looks like the error is probably somewhere on my page. Have to go find what it could be.

    Sorry for troubling you.

    Peter

  6. #6
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try the below modified .js file...

    anylinkmenu.js
    Last edited by jscheuer1; 01-28-2017 at 01:24 AM. Reason: make attachment explicit
    DD Admin

  7. #7
    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 peter117 View Post
    Works OK on a stripped down page, so looks like the error is probably somewhere on my page. Have to go find what it could be.

    Sorry for troubling you.

    Peter
    Quote Originally Posted by ddadmin View Post
    Try the below modified .js file...

    anylinkmenu.js
    If you're still having problems, a link to you page may help us pinpoint the issue.
    - John
    ________________________

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

  8. #8
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Tracked down the problem to the "google translate" script. Something in their javascript must be conflicting with anylinkmenu.js on mobiles.

    Updated anylinkmenu.js and no longer any conflict with google translate.

    Thanks for the help. Peter

  9. #9
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,846
    Thanks
    49
    Thanked 251 Times in 243 Posts
    Blog Entries
    56

    Default

    May I add the following for an explanation of the problem (now solved, apparently). Menus, tooltips etc. not hiding after a tap somewhere on the screen typically is a focus problem with iOS.
    You can solve it by having the following at the end of the body section of the page:
    Code:
    var eventList = ["click", "touchstart"];
    for(event of eventList) {
    document.body.addEventListener(event, function(e) {
    if(e.target.id!=='YOUR_MAIN_MENU_BUTTON(S) OR TOOLTIP'){setTimeout(function () {YOUT_HIDE_INSTRUCTION}, 0);}
    });
    }

Similar Threads

  1. Updating one dropdown with another
    By drj201 in forum JavaScript
    Replies: 5
    Last Post: 11-01-2007, 01:26 PM
  2. 1. AnyLink Drop Down Menu (No Dropdown in IEThe The 4 colored bars)
    By EurocarAdv in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 07-09-2007, 04:46 PM
  3. AnyLink Dropdown Menu
    By Johnnymushio in forum Dynamic Drive scripts help
    Replies: 6
    Last Post: 11-05-2006, 04:18 AM
  4. AnyLink Dropdown Menu
    By sysrq868 in forum Dynamic Drive scripts help
    Replies: 8
    Last Post: 04-04-2005, 06:24 PM
  5. PLEASE help me with the AnyLink Dropdown Menu!
    By starlingpacific in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 02-11-2005, 03:06 PM

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
  •