|
@@ -3,42 +3,69 @@ function wrap(){
|
|
$('#start > div:nth-child(n+2)').wrapAll('<div class="bottom"></div> ')
|
|
$('#start > div:nth-child(n+2)').wrapAll('<div class="bottom"></div> ')
|
|
};
|
|
};
|
|
|
|
|
|
-function resize() {
|
|
|
|
- $(window).on("load resize", function() {
|
|
|
|
- $("#recits").resizable();
|
|
|
|
- // $( "#reseaux-sociaux" ).resizable();
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
function drag() {
|
|
function drag() {
|
|
|
|
|
|
var $hand = $( ".handler" );
|
|
var $hand = $( ".handler" );
|
|
|
|
|
|
$hand.draggable({
|
|
$hand.draggable({
|
|
drag: function(){
|
|
drag: function(){
|
|
|
|
+
|
|
|
|
+ // dimension handler
|
|
|
|
+ var $heighthand = $(this).outerHeight();
|
|
|
|
+ var $widthhand = $(this).outerWidth();
|
|
|
|
+ // ajust handler
|
|
|
|
+ var ajustH = $heighthand /2;
|
|
|
|
+ var ajustW = $widthhand /2;
|
|
|
|
+
|
|
|
|
+ // position handler
|
|
var offset = $(this).offset();
|
|
var offset = $(this).offset();
|
|
- var xPos = offset.left;
|
|
|
|
- var yPos = offset.top;
|
|
|
|
- $('#posX').text('x: ' + xPos);
|
|
|
|
- $('#posY').text('y: ' + yPos);
|
|
|
|
- console.log(yPos);
|
|
|
|
|
|
+ var xPos = offset.left + ajustW;
|
|
|
|
+ var yPos = offset.top - ajustH;
|
|
|
|
+
|
|
|
|
+ var xPos2 = xPos + (ajustW * 2);
|
|
|
|
+ var yPos2 = yPos + (ajustH * 2);
|
|
|
|
|
|
|
|
+ // top
|
|
var $recits = $(this).parent('#page').find('#recits');
|
|
var $recits = $(this).parent('#page').find('#recits');
|
|
var $itw = $(this).parent('#page').find("#interviews");
|
|
var $itw = $(this).parent('#page').find("#interviews");
|
|
var $links = $(this).parent('#page').find("#links");
|
|
var $links = $(this).parent('#page').find("#links");
|
|
|
|
+
|
|
|
|
+ // bottom
|
|
var $rs = $(this).parent('#page').find("#reseaux-sociaux");
|
|
var $rs = $(this).parent('#page').find("#reseaux-sociaux");
|
|
|
|
+ var $stmp = $(this).parent('#page').find("#streetmap");
|
|
|
|
+ var $img = $(this).parent('#page').find("#img");
|
|
|
|
+
|
|
|
|
+ // style
|
|
|
|
+ var style_recit = { width: xPos, height : yPos }
|
|
|
|
+ var style_height = { height : yPos }
|
|
|
|
+
|
|
|
|
+ // app style
|
|
|
|
+ $recits.css(style_recit);
|
|
|
|
+ $itw.css(style_height);
|
|
|
|
+ $links.css(style_height);
|
|
|
|
+
|
|
|
|
+ // width div
|
|
|
|
+ var $w0 = $('html').outerWidth();
|
|
|
|
+ var $w1_1 = $recits.outerWidth();
|
|
|
|
+ var $w1_2 = $itw.outerWidth();
|
|
|
|
+ var $w1_3 = $links.outerWidth();
|
|
|
|
+
|
|
|
|
+ var $w2_1 = ($w1_2 + $w1_3) - $w0;
|
|
|
|
+ var $w2_2 = ($w1_1 + $w1_3) - $w0;
|
|
|
|
+ var $l2_2 = ($w1_1);
|
|
|
|
+ var $l2_3 = ($l2_2 + $w1_2);
|
|
|
|
+ var $w2_3 = ($w1_1 + $w1_2) - $w0;
|
|
|
|
|
|
- var $grid1 = $(this).parent('.top');
|
|
|
|
- var $grid2 = $(this).parent('.bottom');
|
|
|
|
|
|
+ // style_bottom
|
|
|
|
+ var yPos2 = yPos + (ajustH * 2);
|
|
|
|
|
|
- $grid1.css('griqd-template-columns', xPos + 'auto auto' );
|
|
|
|
- $grid2.css('grid-template-columns', xPos + 'auto auto' );
|
|
|
|
|
|
+ var $style_rs = { width: xPos, top : yPos2 }
|
|
|
|
+ var $style_stmp = { width: $w1_2, top : yPos, left : $l2_2 }
|
|
|
|
+ var $style_img = { width: $w1_3, top : yPos, left : $l2_3 }
|
|
|
|
|
|
- $recits.css('width', xPos);
|
|
|
|
- $rs.css('width', xPos);
|
|
|
|
- $recits.css('height', yPos);
|
|
|
|
- $itw.css('height', yPos);
|
|
|
|
- $links.css('height', yPos);
|
|
|
|
|
|
+ $rs.css($style_rs);
|
|
|
|
+ $stmp.css($style_stmp);
|
|
|
|
+ $img.css($style_img);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -46,5 +73,4 @@ function drag() {
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
wrap();
|
|
wrap();
|
|
drag();
|
|
drag();
|
|
- // resize();
|
|
|
|
});
|
|
});
|