Reputation: 27
I want to disable extra JavaScript functions for my WordPress website , because speed of my website is very slow for small screens. i did use multiple plugins for cache, image optimization and for minimizing the JavaScript and Css.Even though I compressed all the JavaScript and Css but its still really slow for mobile devices ,Can you refer me some plugin for disabling JavaScript for mobile views in WordPress, if there is no such a plugin i will go with custom coding..Thank you...
Upvotes: 1
Views: 922
Reputation: 2658
Calculate window.innerWidth and do this
if(window.innerWidth > 767) {// you can mention your own width.
//Write all your js code here.
}
Upvotes: 0