|
@@ -24,10 +24,11 @@ function click_link() {
|
|
success: function(data) {
|
|
success: function(data) {
|
|
$(data).find('#item_list').addClass(cat).insertAfter($this);
|
|
$(data).find('#item_list').addClass(cat).insertAfter($this);
|
|
$this.addClass('open');
|
|
$this.addClass('open');
|
|
|
|
+
|
|
},
|
|
},
|
|
complete: function(data) {
|
|
complete: function(data) {
|
|
console.log('cat', cat);
|
|
console.log('cat', cat);
|
|
- // animate();
|
|
|
|
|
|
+ lazyload();
|
|
click_img(e, $this, $href, url, page, cat, project_name);
|
|
click_img(e, $this, $href, url, page, cat, project_name);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -65,10 +66,12 @@ function click_list() {
|
|
$('#item_list.'+cat+' .card-image.open #item').remove();
|
|
$('#item_list.'+cat+' .card-image.open #item').remove();
|
|
$('#item_list.'+cat+' .card-image').removeClass('open');
|
|
$('#item_list.'+cat+' .card-image').removeClass('open');
|
|
$(data).find('#item').addClass(cat).insertAfter($link_card);
|
|
$(data).find('#item').addClass(cat).insertAfter($link_card);
|
|
|
|
+
|
|
$link_card.parent().addClass('open');
|
|
$link_card.parent().addClass('open');
|
|
|
|
|
|
},
|
|
},
|
|
complete: function(data) {
|
|
complete: function(data) {
|
|
|
|
+ lazyload();
|
|
// animate();
|
|
// animate();
|
|
marg_item(project_name);
|
|
marg_item(project_name);
|
|
},
|
|
},
|
|
@@ -81,6 +84,7 @@ function click_list() {
|
|
type : 'GET', // Le type de la requête HTTP
|
|
type : 'GET', // Le type de la requête HTTP
|
|
dataType:'html',
|
|
dataType:'html',
|
|
success: function(data) {
|
|
success: function(data) {
|
|
|
|
+
|
|
$(data).find('#item_list').addClass(cat).insertAfter($link_txt);
|
|
$(data).find('#item_list').addClass(cat).insertAfter($link_txt);
|
|
$link_txt.addClass('open');
|
|
$link_txt.addClass('open');
|
|
|
|
|
|
@@ -94,6 +98,7 @@ function click_list() {
|
|
},
|
|
},
|
|
complete: function(data) {
|
|
complete: function(data) {
|
|
console.log('cat', cat);
|
|
console.log('cat', cat);
|
|
|
|
+ lazyload();
|
|
|
|
|
|
var $link_card = $('.card > #'+project_name + ' a');
|
|
var $link_card = $('.card > #'+project_name + ' a');
|
|
|
|
|
|
@@ -114,6 +119,7 @@ function click_list() {
|
|
},
|
|
},
|
|
complete: function(data) {
|
|
complete: function(data) {
|
|
// animate();
|
|
// animate();
|
|
|
|
+ lazyload();
|
|
marg_item(project_name);
|
|
marg_item(project_name);
|
|
},
|
|
},
|
|
});
|
|
});
|
|
@@ -147,12 +153,14 @@ function click_img(e, $this, $href, url, page, cat, project_name) {
|
|
success: function(data) {
|
|
success: function(data) {
|
|
$('#item_list.'+cat+' .card-image.open #item').remove();
|
|
$('#item_list.'+cat+' .card-image.open #item').remove();
|
|
$('#item_list.'+cat+' .card-image').removeClass('open');
|
|
$('#item_list.'+cat+' .card-image').removeClass('open');
|
|
-
|
|
|
|
$(data).find('#item').addClass(cat).insertAfter($this);
|
|
$(data).find('#item').addClass(cat).insertAfter($this);
|
|
$this.parent().addClass('open');
|
|
$this.parent().addClass('open');
|
|
marg_item(project_name);
|
|
marg_item(project_name);
|
|
anchor($href);
|
|
anchor($href);
|
|
},
|
|
},
|
|
|
|
+ complete:function() {
|
|
|
|
+ lazyload();
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
@@ -183,10 +191,10 @@ function marg_item(project_name) {
|
|
|
|
|
|
var margin_right = $item_list.width() - (pos_card + $card.width());
|
|
var margin_right = $item_list.width() - (pos_card + $card.width());
|
|
|
|
|
|
-console.log('$card.width()',$card.width());
|
|
|
|
-console.log('pos_card',pos_card);
|
|
|
|
|
|
+ console.log('$card.width()',$card.width());
|
|
|
|
+ console.log('pos_card',pos_card);
|
|
|
|
|
|
-console.log('$item_list',$item_list.width());
|
|
|
|
|
|
+ console.log('$item_list',$item_list.width());
|
|
|
|
|
|
$item.css('margin-left', '-'+$item_offset +'px');
|
|
$item.css('margin-left', '-'+$item_offset +'px');
|
|
// $item.parents('.card').css('margin-right', margin_right);
|
|
// $item.parents('.card').css('margin-right', margin_right);
|
|
@@ -228,6 +236,20 @@ function mouseHover() {
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+function lazyload() {
|
|
|
|
+ $('.lazy').Lazy({
|
|
|
|
+ // your configuration goes here
|
|
|
|
+ // scrollDirection: 'vertical',
|
|
|
|
+ effect: "fadeIn",
|
|
|
|
+ effectTime: 900,
|
|
|
|
+ threshold: 0
|
|
|
|
+ // visibleOnly: true,
|
|
|
|
+ // onError: function(element) {
|
|
|
|
+ // console.log('error loading ' + element.data('src'));
|
|
|
|
+ // }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
$(document).ready(function($){
|
|
$(document).ready(function($){
|
|
click_link();
|
|
click_link();
|
|
click_list();
|
|
click_list();
|