$(function(){ var pcURL = "https://www.e-map.ne.jp/p/gskhtmw/"; var smtURL = "https://www.e-map.ne.jp/smt/gskhtmw/"; var device = ''; var ua = navigator.userAgent.toLowerCase(); if(ua.indexOf('iphone') > -1){ device = 'iphone'; }else if(ua.indexOf('ipad') > -1){ device = 'ipad'; }else if((ua.indexOf('android') > -1) && (ua.indexOf('mobile') > -1)){ device = 'android'; }else if((ua.indexOf('android') > -1) && (ua.indexOf('mobile') == -1)){ device = 'android_tab'; }else{ device = 'pc'; } if(device == "pc" || device == "ipad"){ $(".searchB_PC").css("display","block"); }else{ $(".searchB_SMT").css("display","block"); } /* $(".searchB").click(function(event) { if(device == "pc" || device == "ipad"){ window.location.href = pcURL; }else{ window.location.href = smtURL; } return false; }); */ });