I have the following jQuery
code.
$(".item").hover(function(){
$(this).find('.item-hover').css("display","block");
}, function(){
$(this).find('.item-hover').css("display","none");
});
I want this jQuery
code to work only if the screen size is bigger than 768.
I tried the following method but it didn't helped me.
$(window).resize(function() {
if ($(this).width() >= 768) {
$(".item").hover(function(){
$(this).find('.item-hover').css("display","block");
}, function(){
$(this).find('.item-hover').css("display","none");
});
}