<script src="http://www.google.com/jsapi"></script>
<script>
// Load jQuery
google.load("jquery", "1.2.6");
</script>
<script src="r/insum/files/static/v2Y/jquery.ui.all.js"></script>
<script>
$().ready(function() {
$("#my_form_id, #my_form_id_2").each(function() {
var myElement = $(this);
$.ajax({
type: "POST",
url: "wwv_flow.show",
data: {'x01':$(this).attr("id"),
p_flow_id:$('#pFlowId').attr("value"),
p_flow_step_id:$('#pFlowStepId').attr("value"),
p_instance:$('#pInstance').attr("value"),
p_request:"APPLICATION_PROCESS=GET_PAGE_REGION_POSITION"
},
dataType: "json",
success: function(data, textStatus){
myElement.css("left",data[0].position_left);
myElement.css("top",data[0].position_top);
},
complete: function(){
myElement.css("background-color","white");
myElement.css("display","");
}
});
});
$("#my_form_id, #my_form_id_2").draggable({
cursor: 'move',
opacity: 0.75,
revert: "invalid",
stop: function(e, ui) {
$(this).parent().css({borderStyle:"none", backgroundColor:"white"});
// send request
$.post("wwv_flow.show",
{'x01':$(this).attr('id'),
'x02':$(this).css("left"),
'x03':$(this).css("top"),
p_flow_id:$('#pFlowId').attr("value"),
p_flow_step_id:$('#pFlowStepId').attr("value"),
p_instance:$('#pInstance').attr("value"),
p_request:"APPLICATION_PROCESS=SET_PAGE_REGION_POSITION"
}
);
}
});
$("#my_form_id").parent().droppable({
accept: "#my_form_id, #my_form_id_2",
activeClass: 'droppable-active',
hoverClass: 'droppable-hover',
over: function(e, ui) {
$(this).css({borderStyle:"dashed", backgroundColor:"#D4FF7F"});
},
out: function(e, ui) {
$(this).css({borderStyle:"dotted", backgroundColor:"#FFD455"});
},
drop: function(e, ui) {
$(this).css({borderStyle:"none", backgroundColor:"white"});
}
});
});
</script> |