Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.validator.addMethod("data-rule-imageFacebookResolution", function (value, elem, attrValue) {
- var _URL = window.URL;
- var file, img;
- if ((file = elem.files[0])) {
- img = new Image();
- img.onload = function () {
- alert("Width:" + this.width + " Height: " + this.height);
- if (this.width < 520 && this.height < 290) {
- return false;
- } else {
- return true;
- }
- };
- img.src = _URL.createObjectURL(file);
- }
- return false;
- }, "@Strings.Shared_ImageResolutionError");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement