Reputation: 163
I have a navigation menu that slides out onto the webpage using .animate(). It looks great until the the browser size gets below 1000px. is there a way to tell jquery to not use the function I created if the viewport is smaller than 1000px, so I can let css take over?
Upvotes: 0
Views: 103
Reputation: 113
I dont't know if there is a nice and small solution for that, but you can check the window width if it is bigger then 1000px and than load the script.
if($(window).width() > 1000) {
$.getScript // http://api.jquery.com/jQuery.getScript/
}
Upvotes: 1
Reputation: 3949
I don't think you can desactivate jQuery in CSS, but before you animate you can do that :
if($(window).width() > 1000) {
//animate
}
Upvotes: 1