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>
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