amélioration swiper suite

This commit is contained in:
Deltacms 2023-02-12 09:07:24 +01:00
parent 980a0cf07f
commit 0cfd27f385
2 changed files with 32 additions and 29 deletions

View File

@ -1,32 +1,34 @@
/* Script pour bannière animée avec effet de défilement vertical */
/* Adapte la largeur et la hauteur des images de la bannière à la taille de la fenêtre client */
$(document).ready(function(){
$.wrapper = function(){
var heightMod ,
widthMod,
wclient;
wclient = window.innerWidth;
switch ( verticalBannerWidthSite )
{
case "75vw":
widthMod = 0.75 * wclient;
break;
case "85vw":
widthMod = 0.85 * wclient;
break;
case "95vw":
widthMod = 0.95 * wclient;
break;
default:
widthMod = wclient;
}
heightMod = verticalBannerHeightImg * ( widthMod / verticalBannerWidthImg );
$("#headerSwiper .swiper").css("width", widthMod);
$.wrapper = function(){
var heightMod ,
widthMod,
wclient;
wclient = window.innerWidth;
switch ( verticalBannerWidthSite )
{
case "75vw":
widthMod = 0.75 * wclient;
break;
case "85vw":
widthMod = 0.85 * wclient;
break;
case "95vw":
widthMod = 0.95 * wclient;
break;
default:
widthMod = wclient;
}
heightMod = verticalBannerHeightImg * ( widthMod / verticalBannerWidthImg );
$("#headerSwiper .swiper").css("width", widthMod);
$("#headerSwiper .swiper").css("height", heightMod);
}
$(document).ready(function(){
$.wrapper();
});
$(window).resize(function(){
$.wrapper();
$(window).resize(function(){
$.wrapper();
});
});

View File

@ -1,16 +1,17 @@
/** Swiper pour Deltacms personnalisation **/
/*
#headerSwiper .swiper {
width: 100%;
height: 100%;
}
*/
/* la class swiper-wrapper est modifiée par le script contenu dans le json theme/header/swiperContent */
/*
#headerSwiper .swiper-wrapper{
width: 100%;
max-height: 600px;
}
*/
#headerSwiper .swiper-slide {
display: flex;
justify-content: center;
@ -21,6 +22,6 @@
display: block;
width: 100%;
height: 100%;
max-height: 600px;
max-height: 600px;
object-fit: cover;
}