Search code examples
javascriptphotoswipe

Photoshop Basic JS Implementation


I set up a very basic page http://neighborhoodpets.wink1733.com with three images to try Photoswipe 4.0.

I am following the "Getting Started" documentation at: http://photoswipe.com/documentation/getting-started.html

I am getting the following error: (index):162 Uncaught TypeError: Cannot read property 'split' of null

I am new to JS, so I am just copy/pasting the script. Thank you for any help.


Solution

  • Following code is referencing to data-size attribute in yout anchor tag:

    el.getAttribute('data-size')
    

    This means that your HTML code for that anchor tag should look like:

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