我希望诈骗队身体健康。。!
我只想当我移动一个小部件时,其他小部件不会向上移动以填充它的空白位置。。!
相反,当我移动一个小部件时,我更希望其他小部件保持在它们的位置,而不是向上填充新移动的小部件位置。。!
我该怎么做?谁能告诉我。。?我试着到处检查和搜索,但要么没有得到,要么没有得到如何使它工作。。!
<script type="text/javascript">
var jq=jQuery.noConflict();
jq(document).ready(function (e) {
jq('.upload').on('submit',(function(e) {
e.preventDefault();
var formData = new FormData(this);
jq.ajax({
type:'POST',
url: jq(this).attr('action'),
data:formData,
cache:false,
contentType: false,
processData: false,
success: function(data)
{
jq(".no_image").css("display", "none"),
jq(".show_image").css("display", "block"),
jq(".profile_photo").val(function(index, currentValue) {
return currentValue + data;
});
jq(".image").attr("src","client_images/"+data);
},
error: function(data){
console.log("error");
console.log(data);
}
});
}));
jq(".inputFile").on("change", function() {
jq(".upload").submit();
});
$(function () {
var options = {
cell_height: 70
};
$('.grid-stack').gridstack(options);
this.grid = $('.grid-stack').data('gridstack');
this.save_grid = function () {
this.serialized_data = _.map($('.grid-stack > .grid-stack-item:visible'), function (el) {
el = $(el);
var node = el.data('_gridstack_node');
return {
x: node.x,
y: node.y,
width: node.width,
height: node.height
};
}, this);
$.ajax
({
type: "POST",
//the url where you want to sent the userName and password to
url: 'save_grid.php',
async: false,
//json object to sent to the authentication url
data: {'positions': JSON.stringify(this.serialized_data, null, ' ')},
success: function () {
alert("Positions Saved!");
}
})
}.bind(this);
$('#save-grid').click(this.save_grid);
this.load_grid();
});
});
</script>
实时示例:
http://troolee.github.io/gridstack.js/