简体   繁体   中英

How do I load jquery mobile only for mobile browsers, but the regular site for desktop?

So I have an existing desktop html site, but I've created a jquery mobile version. The thing is I'm trying to figure out how to load only the jquery mobile version for mobile phones, but show the desktop version for desktops. I couldn't find anything on the jquery mobile documentation.

You can essentially do with with jquery using the window width or by triggering it on CSS media query breakpoints. A few references below:

Triggering jquery with css media queries

http://www.venveo.com/articles/view/quick-tip-jquery-media-queries

I am however now sure of the ramifications of making it responsive... once jquery mobile kicks in, all bets are off.

You are probably better off calling the jquery mobile on a browser detection rather than a screen breakpoint.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM