Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

"TypeError: $menu.smartmenus is not a function" IN Firefox Only

Home Forums Older releases 1.0.x "TypeError: $menu.smartmenus is not a function" IN Firefox Only

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8414
    Niko300
    Participant

    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 !

    #8500
    Niko300
    Participant

    up

    #8625
    admin
    Keymaster

    Please post some kind of demo URL. Something else is probably causing this, I suspect multiple jQuery versions included on the page.

    #8989
    lukewsmith
    Participant

    Hello,

    We’re having the same problem, example below

    https://kwiksurveys.com/

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘1.0.x’ is closed to new topics and replies.