Hi,
I use the version “SmartMenus jQuery Plugin – v1.0.1 – November 1, 2016” but I have the problem with all versions of smartmenus.
The problem occurs only with Firefox and freeze the processing blocking the add of an item in the Cart.
The function that have to refresh the list of item in the “Cart” menu item give me this error in the console :
TypeError: $menu.smartmenus is not a function
Here is my code :
<script type="text/javascript" src="js/jquery-1.9.0.min.js"></script>
<!-- SmartMenus jQuery plugin -->
<script type="text/javascript" src="js/jquery.smartmenus.js"></script>
<!-- SmartMenus core CSS (required) -->
<link href="css/sm-core-css.css" rel="stylesheet" type="text/css" />
<!-- "sm-blue" menu theme (optional, you can use your own CSS, too) -->
<link href="css/sm-blue/sm-blue.css" rel="stylesheet" type="text/css" />
<script>
function refreshMenu()
{
var $menu = $('#main-menu');
// refresh the menu after the DOM operations
$menu.smartmenus('refresh');
}
$(function(){
$('#main-menu').smartmenus({
subMenusSubOffsetX: 1,
subMenusSubOffsetY: -8
});
.......
});
</script>
....
function addToCart(id_,moimeme)
{
addToPanier(id_);
data2 = getPanier(langueGlobale);
setPanier(data2);
checkForPanierBtn();
if (location.href.indexOf("preview") > -1)
checkForPanierBtnPreview();
////////// == HERE THE REFRESH THAT LET PROBLEM ON FIREFOX : == ///////
refreshMenu();
//////////============////////////////////////////
$(moimeme).parent().parent().prev().children(".miniature2").stop(true, false).animate({ left: "500px", top: "-850px", width: -10, height:-10,opacity:0}, 1800, "swing", function() {
$(moimeme).parent().parent().prev().children(".miniature2").remove();
$(moimeme).parent().parent().prev().append('<img alt="" />');
});
I have the problem when the addToCart() function is called but too all functions that use the refresh directive of smartmenus.
The only smartmenus call that do not error in Firefox is the first call in the “on ready” jQuery function…
All other browser do not any problems !
Can you help me ?
thank you in advance !