title: PhotoSwipe open photo in new window
body: <p>I'm trying to open the current visible photo in a new window with javascript, but it must also work on the iPad.
  What I tried is to add a button to the toolbar (like in the example). I did also add the css of that button in the photoswipe.css. I've added a javascript function:</p>
  
  <pre><code>function getImgUrl()
  {
      var divHead = getElementsByClassName(document, 'ps-carousel-content');
      var imgElement = divHead[0].getElementsByTagName("img");
      var imgUrl = imgElement[1].getAttribute('src');
      window.open(imgUrl.toString())
  }
  </code></pre>
  
  <p>And I did use the code from the example to get the custom toolbar but added the piece that creates the buttons:</p>
  
  <pre><code>getToolbar: function(){
      return '&lt;div class="ps-toolbar-close"&gt;&lt;div class="ps-toolbar-content"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ps-toolbar-play"&gt;&lt;div class="ps-toolbar-content"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ps-toolbar-previous" style="padding-top: 12px;"&gt;&lt;div class="ps-toolbar-content"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ps-toolbar-next"&gt;&lt;div class="ps-toolbar-content"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div onclick="javascript: getImgUrl();" class="ps-toolbar-download"&gt;&lt;div class="ps-toolbar-content"&gt;&lt;/div&gt;&lt;/div&gt;';
  }
  </code></pre>
  
  <p>This works perfectly (the photo opens in a new window/tab) in the webkit-browsers like chrome and safari. But when I try this on the iPad, it doesn't work. Simple nothing happens when i push the button.</p>
  
  <p>Can anybody help me to solve this problem? Maybe i'm doing it all wrong, so tell me if a different approach would be better.</p>
  
  <p>Thanks!</p>