JS to determine the mobile end or PC, mobile px conversion to REM, Mobile end Fillet

Source: Internet
Author: User

Determine whether a PC or mobile
if (/applewebkit. mobile/i.test (navigator.useragent) | | (/midp| symbianos| nokia| Samsung| Lg| nec| tcl| alcatel| bird| dbtel| dopod| philips| haier| lenovo| mot-| nokia| sonyericsson| sie-| amoi| Zte/.test (navigator.useragent))) {
if (Window.location.href.indexOf ("mobile") <0) {
try{
if (/android|webos|iphone|ipod| Blackberry/i.test (navigator.useragent)) {
Cell phone
}else if (/ipad/i.test (navigator.useragent)) {
}else{
Pc
}
}catch (e) {}
}
}
Unit conversions:
<script>
(Function (doc, win) {
var docel = doc.documentelement,
resizeevt = ' orientationchange ' in window? ' Orientationchange ': ' Resize ',
Recalc = function () {
var clientwidth = docel.clientwidth;
if (!clientwidth) return;
if (clientwidth>=1080) {
docEl.style.fontSize = ' 100px ';
}else{
DocEl.style.fontSize =
(clientwidth/1080) + ' px ';
}
};

    if (!doc.addEventListener) return;    win.addEventListener(resizeEvt, recalc, false);    doc.addEventListener(‘DOMContentLoaded‘, recalc, false);})(document, window);

</script>
if (clientwidth>=1080) design manuscript width is how much to change how much is now 1080px, if is 750 to carry 750

Mobile End Fillet
Input,textarea{-webkit-appearance:none; border-radius:0;/ Remove input Default style /}

JS to determine the mobile end or PC, mobile px conversion to REM, Mobile end Fillet

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.