Answer the question
In order to leave comments, you need to log in
How to make the frame resize in real time?
fotooboikin.ru/neboskrebyi
Now the frame appears if you enter the size in the fields (width/height) and drag the mouse over the picture. How to make it so that when entering into the form, the size of the selected area immediately changes (and it was not necessary to hold the mouse for this). The imgSelectArea plugin is used.
odyniec.net/projects/imgareaselect
$(document).ready(function () {
var height = 0;
var width = 0;
var img_width = 0;
var img_height = 0;
var min_width = 0;
var min_height = 0;
var timer = $.timer(function() {
height = $('input[name="height"]').val();
width = $('input[name="width"]').val();
coaf_get = $('select option:selected').val();
kachestvo_get = $('input[name=browser]:checked').val();
add_get = $('input[name=browse]:checked').val();
img_width = $('.img-posts').width();
img_height = $('.img-posts').height();
****************
расчет цены
***************
min_height = img_height;
min_width = img_width;
if(width > height)
min_width = img_width;
if(height > width)
min_height = img_height;
if(height == '' || width == '') {
//alert('Введите высоту и ширину')
} else {
$('.img-posts').imgAreaSelect({
aspectRatio: width + ':' + height,
handles: true,
parent: '.kart',
show: true,
minWidth: min_width,
minHeight: min_height,
keys: true
});
}
});
timer.set({ time : 1000 });
timer.play();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question