javascript - How to prevent a save without having cropped an image with imgAreaSelect -
javascript - How to prevent a save without having cropped an image with imgAreaSelect -
i'm using imgareaselect plugin allow users crop image. prevent user hits save button without having cropped image. i'm looking solutation in javascript instead of checking server side if image has been cropped.
from samples in imgareaselect api:
$('img#photo').imgareaselect({ onselectend: function (img, selection) { alert('width: ' + selection.width + '; height: ' + selection.height); } });
just check if selection.width
, selection.height
> 0
javascript jquery
Comments
Post a Comment