LoginSignup
2
0

More than 3 years have passed since last update.

fancyboxでモーダルを作ったが、androidで開きスワイプするとクローズしてしまうとき

Last updated at Posted at 2019-05-15

背景

fancyboxのモーダルで、androidだけなぜかスワイプするとモーダルの続きが読めずに閉じてしまうバグを修正してほしいと依頼がきました。

解決

fancyboxに用意されているmodal: trueというモーダル用のオプションが抜けていました。追加して解決です。

$('#btn').fancybox({
    modal: true
  .
  .
  .
 ()
});

また、modal: trueにすると右上のクローズボタンが消えてしまうので

<button data-fancybox-close="" class="fancybox-close-small" title="Close"></button>

をモーダルの大枠タグ直下に配置します。

modalオプションのあるなしを比較しながら配置してあげると楽かもしれません。

2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0