Friday 10 February 2017

Add your own custom jquery in magento 2

 When using custom jquery then not need add cdn jquery library link.Because by default in magneto 2 added jquery library links.
 
require(['jquery'],function($){
    $(window).load(function() {
       <!----code---->
    });
});



 
Example:
<script>
 require(['jquery'],function($){
    $(window).load(function() {
        $('.nav-toggle').click(function(){
  $('.top_nav').toggleClass("show-hide");
  });
    });
});

</script>

No comments:

Post a Comment