Photoshop 基本 JS 实现

Photoshop Basic JS Implementation

我用三张图片设置了一个非常基本的页面 http://neighborhoodpets.wink1733.com 来试用 Photoswipe 4.0。

我正在关注 "Getting Started" 文档:http://photoswipe.com/documentation/getting-started.html

我收到以下错误:(index):162 Uncaught TypeError: Cannot read 属性 'split' of null

我是JS新手,所以我只是copy/pasting脚本。感谢您的帮助。

以下代码引用了您 anchor 标签中的 data-size 属性:

el.getAttribute('data-size')

这意味着该锚标记的 HTML 代码应如下所示:

<a href="large-image.jpg" itemprop="contentUrl" data-size="600x400">