cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <!--------

  Lately I have played with HTML5 file and d&d API:
  https://codepen.io/jaysalvat/pen/agLyf

  I end up developing a jQuery plugin...

  You can fork it on Github:
  https://github.com/jaysalvat/ezdz

  Here is the quick demo.

--------->

<h1>Ezdz quick demo</h1>

<p>
  Fork it on 
  <a href="https://github.com/jaysalvat/ezdz">Github</a>
</p>

<form>
  <input type="file" accept="image/png, image/jpeg" />
</form>

<p>Png or Jpeg, max 600x400</p>
            
          
!
            
              body {
  font: 12px Arial;
  margin: 20px auto;
  text-align: center;
  width: 260px;
}

form {
  margin: 20px 0;
}
            
          
!
            
              
$('[type="file"]').ezdz({
  
  text: 'drop a picture',
  
  validators: {
    maxWidth: 600,
    maxHeight: 400
  },
  
  reject: function(file, errors) {
    
    if (errors.mimeType) {
      alert(file.name + ' must be an image');
    }
      
    if (errors.maxWidth) {
      alert(file.name + ' must be width:600px max');
    }

    if (errors.maxHeight) {
      alert(file.name + ' must be height:400px max');
    }
    
  }
});

            
          
!
999px
Loading ..................

Console