Actually i have a hover function which triggers on mouse hover and i want to work this function only on screen size > 768 px as on touch screen there no point to have this function. I have achieved this by adding an if statement in in a javascript function as follow:and placing my jquery inside this function.
function hoverFunction() { if ($(window).width() >760 ){
} }
now this hoverFunction() is called twice once onchange and one onwindow load. Now lets talk about the problem. When i load the page and using developer tools move from large screen seize to small the hover function doen not disable even below 768 px until i refresh the page or i trigger the onchange function. it happens same when i move from small to large screen size, i have to either refresh the page i use onchange. is there any way to over come this issue.