0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravelで PhotoSwipeを手っ取り早く使う方法

Posted at

地味に導入が面倒なのでまとめてみた。

参考

PhotoSwipeSimplify(PhotoSwipeを簡単に使うための超便利なライブラリ(参考サイトこちら)

導入方法

1. npmでインストール

npm install jquery.photoswipe

2. app.jsで読み込む

resource/js/app.js
require('photoswipe');
window.photoswipeSimplify = require('photoswipe-simplify');

3. img群をdata-pswp要素で囲む

<div data-pswp>
... 画像 ...
</div>

4. 初期化をしてスタート

photoswipeSimplify.init();

ってやれば幸せになるよ。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?