Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #638860

    Hi,

    I’m trying to link a menu-item to a script but it doesn’t seem to work. Besides that if the link is outside the avia menu it works properly.

    This is my link in avia:

    <li id=”menu-item-848″ class=”menu-item menu-item-type-gs_sim menu-item-object-gs_sim menu-item-top-level menu-item-top-level-6″>PEDIR ONLINE

    This is my script:
    <script type=”text/javascript”>
    var _pyw = {
    _chain: ‘kanu-sushi’,
    _type: ‘online’,
    _country: ‘ar’,
    _linkID: [‘menu-item-847’]
    };
    (function() {var py = document.createElement(‘script’); py.type = ‘text/javascript’; py.async = true;py.src = ‘http://www.pedidosya.com/widget/js/py.min.js?&#8217; + new Date().getTime();var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(py, s);})();
    </script>

    Thanks!

    #638924

    Hey,

    If you say it works elsewhere one thing you could do is use the link outside the menu and have the menu trigger it, with something like:

    <script>
    (function($){
        $(window).load(function() {
        	$('#menu-item-847').on('click', function(){ $('#link_that_works').trigger('click'); });
        });
    })(jQuery);
    </script>

    Best regards,
    Josue

    #638970

    thanks!

    #639031

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘script not working in avia-menu’ is closed to new replies.