What to add what would the function started with a 920 resolution?

$('body').on('click' , 'li' , function(e){
menu.slideToggle();
 });
July 8th 19 at 15:56
3 answers
July 8th 19 at 15:58
Solution
var width = $(window).width();
 if (width<920){
 $('body').on('click' , 'li' , function(e){
menu.slideToggle();
});
 }
July 8th 19 at 16:00
What to add what would the function started with a 920 resolution?

Check the width of the screen ))
I understand)
function windowSize(){
if ($(window).width() <= '920'){
$('body').on('click' , 'li' , function(e){
menu.slideToggle();
});
} else {
}
}

Right?? - Jewel.Smitham commented on July 8th 19 at 16:03
: what do you like to look for the body, why do not want to use a direct link to the document.body - brooks.Greenfelder commented on July 8th 19 at 16:06
July 8th 19 at 16:02
the question is incorrect
- need a function start itself when the resolution will change to 920?
- need function allowed myself to run, if the resolution 920?

Find more questions by tags jQueryJavaScript