JS
if (screen.width <= 768 && screen.width != 1024) {
jQuery('.menu-link').bind("click touchstart", function() {
if (jQuery('#wrap3').css("left") === "0px"){
jQuery('#wrap3').animate({"left":"17%"}, 50);
}
else {
jQuery('#wrap3').animate({"left":"0"}, 50)
}
});
}
I originally tried it like this
if (screen.width <= 768)
It works fine in portrait, but it works in landscape, when it shouldn't.
How can I fix this?
It also doesn't work on desktop which is what I wanted.
On a side note - is this the common practice for creating different JS for different mobile widths? The reason I am using JS instead of CSS3 is because the animations I'm trying to do did not work on ipad.