Elementor Custom Mobile Dropdown Menu Using Containers

Facebook
Twitter
Reddit
WhatsApp

jQuery

				
					<script>
		const openIcon = ""
		const closeIcon = ""
    jQuery(document).ready(function($){
        $('.nav-icon').click(function(){
            if($('.nav-container').is(":visible")){
                $('.nav-icon img').attr('src', openIcon);
            } else {
                $('.nav-icon img').attr('src', closeIcon);
            }
            $('.nav-container').slideToggle(200);
        });
    });
	
jQuery(window).on('resize', function($){
        if ($('body').hasClass('elementor-editor-active')) {
            return;
        }
        let win = $(this);
        if(win.width() > 1024){
            $('.nav-container').show();
        } else {
            $('.nav-icon img').attr('src', openIcon);
            $('.nav-container').hide();
        }
    });
</script>

				
			

CSS

				
					@media(max-width:1024px){
.nav-container{
    display: none;
}    
}

				
			
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

More to explorer

0
Would love your thoughts, please comment.x
()
x

45 Minute Wordpress Support

Get your Wordpress questions answered and your Wordpress issues resolved.