Torch`Ok,
$(document).ready(function() {
$('#submit').bind('click',function(e){
e.preventDefault();
var dataString = '';
var divs = $('div.image');
var data;
divs.each(function (index, self) {
var img = $(self).children('img') ;
var css = img.css(['width', 'height','top','left'])
var id = $(self).attr("id");
var src = img.attr("src");
data = {
'id' : id,
'src' : src,
'width' : css['width'],
'height' : css['height'],
'top' : css['top'],
'left' : css['left']
}
data = JSON.stringify(data); ;
dataString += data
});
var divstxt = $('div.text');
divstxt.each(function (index, self) {
var css = $(self).css(['width', 'height','top','left'])
var text = $(self).html();
data = {
'width' : css['width'],
'height' : css['height'],
'top' : css['top'],
'left' : css['left'],
'text' : text
};
data = JSON.stringify(data); ;
dataString += data
});
$('#jsondata').val(dataString);
$('#jsonform').submit();
});
});