Not sure if this is the right place but im having problems getting this to work
PHP Code:
// superFish $('ul.sf-menu').superfish(); autoArrows: true, animation: {opacity:'show',height:'show'}, //remove current menu class from drop-downs $("ul.sf-menu ul li").removeClass("current-menu-item");
}); });
on the animation line there is the error, if i remove the removeClass line it works fine and adds the little arrow to drop down menu, but if i add the removeClass line the script dont work and it stops all my other scripts from working.
// superFish $('ul.sf-menu').superfish(); autoArrows: true, animation: {opacity:'show',height:'show'}, //remove current menu class from drop-downs $("ul.sf-menu ul li").removeClass("current-menu-item");
but I dunno if this will work, though. Because on top of the Syntax, also the documentation of your frameworks and plug-ins is important. And I don't know anything about the superfish documentation ....
The script works fine until i added $("ul.sf-menu ul li").removeClass("current-menu-item"); which i need in to be able to stop it from showing the blue hover when you go though the menu
Unfortunately, this is wrong. Although it should be common sense to not use a comma after the final entry of an object literal, every current Javascript engine will just ignore it :-)
This should make you start thinking ... you know like a motorist driving against the traffic and every other driver is flashing the lights at him ... you are doing some very essential things very wrong and you need to do a U turn
// superFish $('ul.sf-menu').superfish(); autoArrows: true, animation: {opacity:'show',height:'show'} //remove current menu class from drop-downs $("ul.sf-menu ul li").removeClass("current-menu-item");
}); });
Is what im having problems with getting working, the rest of the code isnt the problem and actually works fine if i remove this part of the code from the file
// superFish
$('ul.sf-menu').superfish();
autoArrows: true,
animation: {opacity:'show',height:'show'}
//remove current menu class from drop-downs
$("ul.sf-menu ul li").removeClass("current-menu-item");
});
});
Is what im having problems with getting working, the rest of the code isnt the problem and actually works fine if i remove this part of the code from the file
That code is completely invalid syntax - the only reason the autoArrows and animation lines don't throw an error before you added the extra line is because JavaScript is able to interpret them in a completely different way to how you expect.
autoArrows: true, <== a label of "autoArrows" followed by a statement that is true - the true result is discarded because it isn't assigned to anything
animation: {opacity:'show',height:'show'} <== a label of "animation" followed by the creation of an anonymous object with opacity and height properties. The anonymous object is also immediately discarded because it isn't assigned to anything.
Commenting out those two lines will not affect the original code.
What you need to do BEFORE adding the statement that created the error is to work out where those two lines have to be moved to in order for them to actually do anything at all.
The following statement is what produces the syntax error when you add the extra code into the end of the statement.
Code:
{opacity:'show',height:'show'} $("ul.sf-menu ul li").removeClass("current-menu-item");
Possibly what you intended is as follows (which would pass an object with autoArrows and animation properties into superfish:
PHP Code:
$('ul.sf-menu').superfish({autoArrows: true, animation: {opacity:'show',height:'show'}});
//remove current menu class from drop-downs
$("ul.sf-menu ul li").removeClass("current-menu-item");