Skip to content

Dropzone.js – 4 [image preview: onclick image, open in new tab]

We often want to download/preview to make it sure what we have uploaded. A small thumbnail preview sometimes not enough. So, here is a small javascript. That will open the image in new tab.

$( document ).ready(function() {
myDropzone.on("addedfile", function(file) {
        file.previewElement.addEventListener("click", function(e) {
          var win ='.dz-image > img')[0].src, '_blank');

Full and final code can be found in my github repository :

One Comment

  1. AffiliateLabz AffiliateLabz

    Great content! Super high-quality! Keep it up! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *