掲題の件で質問です。
ランディングページにiframeタグで表示させている箇所があり、
iframe内にボタンがあるのですが、スマホでクリック(タップ)しても
反応がありません(押せません)。
■やったこと
ボタン箇所のaタグににhref="javascript:void(0);"を追加
iframeじゃないケースだとスマホでもボタンをクリック(タップ)
できるようになりました。
しかし、iframe時ですと、クリックできません。
■追記
HTML(親ページ、子ページ)、JavaScript(子ページ)のコードも追記しました。
HTML(親ページ)
<div class="iframe-wrapper well"> <iframe src="//hogehoge.jp/ltv/index.html" id="parent-iframe" style="border:none" class="iframe iframe-class"></iframe> </div>
HTML(子ページ)
<a class="hsm-ltv-calculate-btn" id="hsm-ltv-calculate-btn" href="javascript:void(0);">計算</a>
JavaScript(子ページ)
<script type="text/javascript"> $(function(){ $("#parent-iframe", window.parent.document).height(document.body.scrollHeight); }); </script> <script type="text/javascript"> $(function(){ /******************************************************************************** * EVENTS ********************************************************************************/ var raitenKaisuuOriginal; var countShinkiKyakuPerMonth; var countCustomerPerMonthTmp; /******************************************************************************** * EVENTS ********************************************************************************/ $(document).on('click', '#hsm-ltv-calculate-btn', function(){ $("#hsm-ltv-result-2").hide(); raitenKaisuuOriginal = undefined; countPerMonthOriginal = undefined; countShinkiKyakuPerMonth = undefined; countCustomerPerMonthTmp = undefined; calculateLTV($("#hsm-ltv-result-1"), $("#hsm-ltv-average-amount").val(), true); $("#parent-iframe", window.parent.document).height(100); $("#parent-iframe", window.parent.document).height(document.body.scrollHeight); }); </script>
iframeを表示させているページに問題があるのでしょうか?
解決法をご存知な方がいらっしゃいましたら、ご教示頂きたく思います。
回答1件
あなたの回答
tips
プレビュー