I am interested in changing the calendar depending if the site is being browsed on a mobile or desktop.
This jQuery has both a calendar mode and an Android mode. http://dev.jtsage.com/jQM-DateBox/
How can I get it to change depending on the browser size?
Would I use something like this
document.documentElement.clientWidth
It would be better to detect browser user_agent and display jquery calendar accordingly. Following is a code example:
if(navigator.userAgent.indexOf("Android") >= 0 || navigator.userAgent.indexOf("iPhone") >= 0) {
// Show mobile calendar
} else {
// Show desktop calendar
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.