'); $("#photo_over").width(data.width); $("#photo_over").height(data.height); $('#photo_over').css({ top: 101, left: 67 }); var width = $("#photo_img").width(); var height = $("#photo_img").height(); z = width/height; $("#slider").slider({ orientation: "horizontal", min: 100, max: 2000, value: data.width, slide: function(event, ui) { y = Math.round(ui.value/z); $('#photo_img').width(ui.value); $('#photo_img').height(y); $('#photo_over').width(ui.value); $('#photo_over').height(y); } }); } }); $('#photo_over').draggable({ start: function() { //$('#photo').css('z-index', 3); $('#fotoramka').css('opacity', 0.9); }, drag: function() { $('#photo_img').css({ top: $("#photo_over").position().top, left: $("#photo_over").position().left }); }, stop: function() { //$('#photo').css('z-index', 1); $('#fotoramka').css('opacity', 1); }, }); }); function create_frame() { $.ajax({ type: "POST", url: "/file/create_frame", data: {photo_id: $('#photo_id').val(), framework_id: 28, width: $("#photo_img").width(), height: $("#photo_img").height(), top: $("#photo_img").position().top, left: $("#photo_img").position().left }, cache: false, dataType: "json", success: function(data) { if(data.result) { document.location.href = data.location; } else { } }, error: function() { alert('Произошла неизвестная ошибка. Возможно, проблемы с подключением к интернету.'); } }); return false; }