responsive item

This commit is contained in:
2019-10-10 17:13:31 +02:00
parent 78c3a80a65
commit c28778eb23
5 changed files with 13 additions and 44 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+7 -38
View File
@@ -145,8 +145,6 @@ function click_img(e, $this, $href, url, page, cat, project_name) {
var $loader = $(this).parents('.card').find('.loader');
e.preventDefault();
if ($this.parent().hasClass('open')) {
@@ -198,45 +196,15 @@ function animate() {
function marg_item(project_name) {
var $item = $('.card-image#'+project_name+' #item');
var $item_offset = $item.offset().left-8;
var $card = $item.parents('.card');
var pos_card = $card.offset().left-8;
var $item_list = $item.parents('#item_list');
var pos_card = $card.offset().left;
$item.css('margin-left', '-'+pos_card +'px');
var margin_right = $item_list.width() - (pos_card + $card.width());
$item.css('margin-left', '-'+$item_offset +'px');
// if new.vignette.left != old.vignette.left
// alors recalcule margin.left
// var timer;
// $(window).resize(function() {
// if(timer) {
// window.clearTimeout(timer);
// }
//
// timer = window.setTimeout(function() {
// // actual callback
// var $item = $('.card-image#'+project_name+' #item');
// console.log($item, '$item');
// console.log( "Firing!" );
//
// var $item_offset = $item.offset().left-8;
// console.log( "$item_offset", $item_offset );
// var $card = $item.parents('.card');
//
// var $item_list = $item.parents('#item_list');
//
// var pos_card = $card.offset().left;
//
// var margin_right = $item_list.width() - (pos_card + $card.width());
// $item.css('margin-left', '-'+$item_offset +'px');
// }, 500);
//
// });
$(window).resize(function() {
var pos_card = $card.offset().left-8;
$item.css('margin-left', '-'+pos_card +'px');
})
}
function mouseHover() {
@@ -334,6 +302,7 @@ function scrollTop() {
})
}
$(document).ready(function($){
// redirection();
click_link();
@@ -5,7 +5,7 @@
right: calc( -20% + 0.5rem);
top: 0;
transition: 0.3s right ease;
background: white;
background: #f9f9f9fe;
z-index: 999;
#icone_list{
z-index: 999;
@@ -147,7 +147,7 @@ body{
vertical-align: baseline!important;
}
#item{
width: calc( 500% + ( #{$marg} * 4) );
width: calc( 80vw + ( #{$marg} * 4) );
padding: 2rem;
margin-top: $marg;
border-radius: 5px;