thanks for that!
however, is it possible to add "ratioDim" somewhat more dynamically,
i.e. could I replace the values in this example (220 and 124) with
variables that I can change via input from some outside form value?
below is some of your example code and further down is a slightly
modified version. the modified version works when I define my new
variable "aa" like this: "var aa = 124;" but does not work when I
define the variable using "var aa = document.myform.myvalue.value;".
the value of the variable "aa" is obviously the same, as inserting an
"alert(aa)" would tell me... but somehow the cropper is affected. any
idea what the problem could be?
ORIGINAL
attachCropper: function() {
if (this.curCrop == null) {
if( this.getTargOrientation() == 'landscape' ) {
ratioDim = { x: 220, y: 124 };
this.curOrientation = 'landscape';
} else {
ratioDim = { x: 124, y: 220 };
this.curOrientation = 'portrait';
}
MODIFIED
attachCropper: function() {
if (this.curCrop == null) {
if( this.getTargOrientation() == 'landscape' ) {
ratioDim = { x: 220, y: 124 };
this.curOrientation = 'landscape';
} else {
var aa = document.myform.myvalue.value;
//var aa = 124;
ratioDim = { x: aa, y: 220 };
this.curOrientation = 'portrait';
}
WITH THIS SOMEWHERE IN THE BODY
<form name="myform">
<input type="hidden" name="myvalue" value="124" />
</form>
On Oct 15, 5:04 pm, David Spurr <
david.sp...@gmail.com> wrote:
> See the example file I've uploaded to the group here:
>
>
http://groups.google.com/group/javascript-image-cropper-ui/web/google...