locked
jquery conflict issue.. RRS feed

  • Question

  • User944339287 posted

    Hi guys.. my responisve menu will not working in mobile view if not included the below file
    http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js

    but my other component will be affected if included this file.

    trying to solve this issue by using noConFlict method but failed.. pls advise. tq

    HTML - HEAD

        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        <script type="text/javascript">
            (function ($) {
    
                $(document).ready(function () {
                    $('#span.menu').click;
                });
    
            } (jQuery.noConflict(true)));
    
            // jQuery has been removed and is undefined at this point
            // so no chance of conflicting with other version of jQuery
    
        </script> 

    HTML - BODY

    <span class="menu"></span>
    <div class="top-menu">
         <nav>
    	<ul class="cl-effect-16">
                <li><a href="#">home</a></li>  
                <li><a href="#">about us</a></li>  
            </ul>
          </nav>		
    /div>
    <!--script-for-menu-->
    <script type="text/javascript">
         $("span.menu").click(function () {
         $(".top-menu").slideToggle("slow", function () {
    		// Animation complete.
         });
    });
    </script>
    <!--//script-for-menu-->
    <div class="clearfix"></div>

    Friday, November 13, 2015 6:17 PM

Answers

  • User61956409 posted

    Hi kengkit,

    Hi guys.. my responisve menu will not working in mobile view if not included the below file
    http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js

    but my other component will be affected if included this file.

    What are the jQuery libraries you are using? Please try to modify the order of JS references. Besides, you could check if there are any errors in F12 developer tools Console tab.

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 15, 2015 9:09 PM