1 2 3 4 5 6 7 8 9 10 | if( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { // not mobile if (navigator.userAgent.indexOf('Mac OS X') != -1) { //is Mac } else { //is PC } }else{ // is mobile } |
1 | $.getScript( "js/SmoothScroll.js" ); |
資料來源:
javascript jquery 判斷是否手機版、平板、mac、pc include 相對應 js 響應式用