Toddish / Popup

A barebones, flexible jQuery popup plugin. Designed for developers, it's simple to use but very powerful.
http://docs.toddish.co.uk/popup
MIT License
146 stars 78 forks source link

Can popup be called by a .bind change? #4

Closed Nocturnaloner closed 10 years ago

Nocturnaloner commented 10 years ago

This throws no errors, but doesn't work. Can you let me know where I went wrong?

<script type="text/javascript">

$('#picture').bind('change', function() { if ( this.files[0].size > 2097152 )

$('.default_popup').popup({
  content : function(){ return 'Your picture is' + this.files[0].size + ' bytes, which is too big. It needs to be below 2097152 bytes (2MB).'}
});

else 
$('.default_popup').popup({
  content : 'Your picture is the right size!.' });

  });

</script>
Toddish commented 10 years ago

Hey,

This is possible, you just need to change how you're calling the popup.

You'll need to create an object and use the open method. Have a look here:

http://docs.toddish.co.uk/popup/#public-methods