発生している問題
preventDefault()
を使えばできると思い、試したけど押した回数だけ履歴が残ってしまう。
該当のソースコード
jQuery
1$(document).on('click', '.item1', function (e) { 2 $(".item1").click(function (e) { 3 e.preventDefault(); 4 $('#iframe').iziModal('open'); 5 $('#modal').iziModal('open', { 6 iframeURL: $(this).data('href') 7 }); 8 }); 9 $("#modal").iziModal({ 10 iframe: true, 11 width: '98%', 12 iframeHeight: 650, 13 zindex: '110', 14 iframeURL: "data.html", 15 group: 'works', 16 overlayColor: 'rgba(0,0,0,0.1)' 17 }); 18 $(".item1").off('click'); 19});
クリックしてモーダルウインドウを出す、という実装をしています。
試したこと
return false;
をすればいいのかなと思ったけど、だめでした
jQuery
1$(document).on('click', '.item1', function (e) { 2 e.preventDefault(); 3 $(".item1").click(function (e) { 4 $('#iframe').iziModal('open'); 5 $('#modal').iziModal('open', { 6 iframeURL: $(this).data('href') 7 }); 8 }); 9 $("#modal").iziModal({ 10 iframe: true, 11 width: '98%', 12 iframeHeight: 650, 13 zindex: '110', 14 iframeURL: "data.html", 15 group: 'works', 16 overlayColor: 'rgba(0,0,0,0.1)' 17 }); 18 $(".item1").off('click'); 19 return false; 20});
回答3件
あなたの回答
tips
プレビュー