Superfish no worky

HershelSR - June 4, 2009 - 11:00
Project:Nice Menus
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

I am using "6.x-2.x-dev 2009-May-07" and the "autoArrows: false" switch which is set in the first superfish() call nice_menus.js works, but because superfish() is called again (to include the bgIframe plugin) and it is called without any options, autoArrows returns to its default value of true and the arrows are thus visible.

I would suggest that the JS code should look more like this:

$(document).ready(function() {
  superFishOptions = {
    // Add the legacy hover class added for IE.
    hoverClass: 'ie-over',
    // Disable generation of arrow mark-up.
    autoArrows: false,
    // Disable drop shadows.
    dropShadows: false,
    // Mouse delay.
    delay: Drupal.settings.nice_menus_options.delay,
    // Animation speed.
    speed: Drupal.settings.nice_menus_options.speed
  }
  $('ul.nice-menu').superfish(superFishOptions);
  // Add in Brandon Aaron’s bgIframe plugin for IE select issues.
  // http://plugins.jquery.com/node/46/release
  $('ul.nice-menu').superfish(superFishOptions).find('ul').bgIframe({opacity:false});
});

with the options passed twice. This code works in my tests.

#1

alexharries - July 6, 2009 - 16:22

Agreed - this appears to work for me too.

#2

enzoch - July 7, 2009 - 09:04

The "delay" option does not work as well.
And I can confirm that this "patch" fixes it.

#3

spaceshare@clea... - September 9, 2009 - 08:57

I had a really tough time finding this, so here are some search terms someone else might be trying: nice menu displaying guillemets >> raquo &raquo "double arrow"

#4

add1sun - September 9, 2009 - 21:25
Title:"autoArrows: false" Does not Appear to Work» Superfish no worky

Yeah the superfish stuff got messed up between the patch and what is in the current dev. If someone could make a patch it would help get this fixed.

#5

marktheshark - September 17, 2009 - 11:06

I tried this.

Arrows disappeared from expandable menu entries.

However, delay still only works after second hover over the entry.

Has anyone solved this?

Thank you

#6

okeedoak - September 20, 2009 - 21:41

subscribing

#7

ryhn - October 4, 2009 - 00:15

Does anyone notice that when the page loads the double arrows load a little after the menu. This causes an unpleasant jump. Is there a fix for this?

#8

jlmeredith - October 5, 2009 - 07:11

Confirm this as a fix for the arrow issues. Will try to get a patch rolled for commit unless there is a better way to implement this fix.

#9

marktheshark - October 5, 2009 - 09:16

Personally I'm not having problems with the arrows after applying the above fix, as I already mentioned.
Haven't seen any official response for the fade-in not working for first hover though...

#10

humanchimp - October 16, 2009 - 21:44

The suggested code is incorrect. You do not need to call .superfish() twice and, in fact, it makes no sense to do so. The code could be written like this:

$(document).ready(function() {
  $('ul.nice-menu').superfish({
    // Add the legacy hover class added for IE.
    hoverClass: 'ie-over',
    // Disable generation of arrow mark-up.
    autoArrows: false,
    // Disable drop shadows.
    dropShadows: false,
    // Mouse delay.
    delay: Drupal.settings.nice_menus_options.delay,
    // Animation speed.
    speed: Drupal.settings.nice_menus_options.speed
  }).find('ul').bgIframe({opacity:false});
});

Also, in JavaScript, when you do not explicitly declare variables, they become implied globals, ending up as properties of the window object, which is rarely what people intend. In other words, use the var keyword to create a local variable.

#11

guix - November 3, 2009 - 15:33

#10 is OK, I'll try to submit a patch when I come back to a place I have CVS access.

#12

guix - November 5, 2009 - 15:13
Status:active» needs review

Here we go

AttachmentSize
nice_menus-481814-12.patch 844 bytes

#13

Branjawn - November 10, 2009 - 18:52

TESTED #12. Works great.

#14

guix - November 10, 2009 - 20:44
Status:needs review» reviewed & tested by the community
 
 

Drupal is a registered trademark of Dries Buytaert.