Home > Web Front-end > HTML Tutorial > 求大神指导如何使【手机浏览器】输入【www网址】自动跳转【手机版】页面!!_html/css_WEB-ITnose

求大神指导如何使【手机浏览器】输入【www网址】自动跳转【手机版】页面!!_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:40:56
Original
1791 people have browsed it

本帖最后由 Anryfree 于 2013-01-16 20:23:56 编辑

手机 浏览器

求了解如何使手机浏览器输入www网址自动跳转手机版页面

比如说,手机浏览器输入www.sina.com.cn,浏览器会自动跳入3g.sina.com.cn,求指导求源代码,在线等!!

回复讨论(解决方案)

获得屏幕尺寸大小

根据尺寸大小转到不同的站点

js??

下面一段代?是?上找?的,?主如果有基???看得懂

??都是比??年的了,像素方面要?整?

function is_mobile() {   var regex_match = /(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i; var u = navigator.userAgent; if (null == u) {  return true; } var result = regex_match.exec(u);  if (null == result) {  return false } else {  return true }}if (is_mobile()) { document.location.href= 'http://www.yuzhiguo.com/wap';}
Copy after login


?有一?,假如?主??有完成手??面的??,可以??很多的jquery手??面便?

?竟一些非商?/社交??的手??面不需要花太多精力

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template