パソコンサイトからスマホサイトへの導線1

こんなふうにしてました。

ヘッダー

<script type="text/javascript">
    if (navigator.userAgent.indexOf('iPhone')>0 ||
        navigator.userAgent.indexOf('iPod')>0 ||
        navigator.userAgent.indexOf('iPad')>0 ||
        navigator.userAgent.indexOf('Windows Phone')>0 ||
        navigator.userAgent.indexOf('Symbian')>0 ||
        navigator.userAgent.indexOf('BlackBerry')>0 ||
        navigator.userAgent.indexOf('Android')>0) {
        document.write('<style type="text/css">#spNavi{display:block;}</style>');
    }else {

    }
</script>

ボディの頭に

	<a id="spNavi" href="./sp/">
		スマートフォン版は<br>こちらをタップ
	</a>

投稿者:

ayako0802

フロントエンドエンジニア