Custom JS for mobile
Ever wanted to use a specific JS for the mobile version of your website? These simple, but powerful, lines of JS tells devices with a screen width less than 540px to use your specific mobile JS. The width can be customized, off course.
/*! Custom mobile JS */
if (document.documentElement.clientWidth < 540) {
<< your mobile JS here >>
}
Written by Axel Ferdinand Giæver
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#