add resize/script.js
This commit is contained in:
parent
408b45e4cc
commit
cdbb4e8c7b
19
ext/resize/script.js
Normal file
19
ext/resize/script.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
$(function() {
|
||||||
|
var original_width = $("#original_width").val();
|
||||||
|
var original_height = $("#original_height").val();
|
||||||
|
|
||||||
|
$("#resize_width").change(function() {
|
||||||
|
if($("#resize_aspect").prop("checked")) {
|
||||||
|
$("#resize_height").val(
|
||||||
|
Math.round($("#resize_width").val() / original_width * original_height)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#resize_height").change(function() {
|
||||||
|
if($("#resize_aspect").prop("checked")) {
|
||||||
|
$("#resize_width").val(
|
||||||
|
Math.round($("#resize_height").val() / original_height * original_width)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user