1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | <? xml version = "1.0" encoding = "Shift_JIS" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < head > < meta name = "viewport" content = "width=device-width,minimum-scale=1, maximum-scale=1, initial-scale=1" > < meta name = "format-detection" content = "telephone=no" > < meta http-equiv = "content-type" content = "text/html; charset=Shift_JIS" /> < meta http-equiv = "content-style-type" content = "text/css" /> < link rel = "stylesheet" href = "../css/sample.css" > < style type = "text/css" > <!-- --> </ style > < title >スマホ ページサンプル</ title > </ head > < body > < script language = "javascript" > <!-- if (navigator.userAgent.indexOf('iPhone') > 0 || navigator.userAgent.indexOf('iPad') > 0 || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0) { document.write('<input type="hidden" name="SCR_type" value="sp" />\n'); //スマートフォン時に実行したいjs } else { document.write('<input type="hidden" name="SCR_type" value="pc" />\n'); } --> </ script > < header id = "page-header" style = "position: relative; overflow: hidden;" > < h1 >応募フォーム</ h1 > </ header > < div id = "wrapper" > < form name = "form1" method = "post" action = "../t_postmail/postmail.cgi" > < input type = "hidden" name = "reception" value = "関口" /> < input type = "hidden" name = "email_from" value = "form@koushuu-sangyou.com" /> < input type = "hidden" name = "email_to" value = "fumio.sekiguchi@ac.auone-net.jp" /> < input type = "hidden" name = "return_to" value = "../06_01recruit/index.html" /> < input type = "hidden" name = "subject" value = "スマホ ページサンプル" /> < input type = "hidden" name = "need" value = "氏名" /> < section class = "entry" > < label class = "smh_left" >氏 名</ label > < input class = "smh_right" name = "お名前" type = "text" size = "20" > </ section > < section class = "entry" > < label class = "smh_left" >年 齢</ label > < div class = "smh_right" > < input name = "年齢" type = "number" size = "8" maxlength = "3" > < span >歳</ span > </ div > </ section > < section class = "entry" > < input type = "submit" value = "送信" style = "margin : 1% 10%; width : 30%; float: left; height:44px" > < input type = "reset" value = "リセット" style = "margin : 1% 10%; width : 30%; float: left; height:44px" > </ section > </ form > < div > < p id = "pagetop" >< a href = "#top" >Page Top</ a ></ p > < footer id = "page-footer" > <!--<p><small>© 2013 しなやか暮らし研究所 --> < p >< small >© 2013 株式会社光洲産業 All Rights Reserved.</ small ></ p > </ footer > </ body > </ html > |
5行目:ビューポートの設定
5 | < meta name = "viewport" content = "width=device-width,minimum-scale=1, maximum-scale=1, initial-scale=1" > |
6行目:電話番号の自動発信を停止
6 | < meta name = "format-detection" content = "telephone=no" > |
19行目~28行目:画面の種類を取得し、以後の自動処理を切り分ける
19 20 21 22 23 24 25 26 27 28 | < script language = "javascript" > <!-- if (navigator.userAgent.indexOf('iPhone') > 0 || navigator.userAgent.indexOf('iPad') > 0 || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0) { document.write('<input type="hidden" name="SCR_type" value="sp" />\n'); //スマートフォン時に実行したいjs } else { document.write('<input type="hidden" name="SCR_type" value="pc" />\n'); } --> </ script > |