eagleman Posted July 4, 2019 Share Posted July 4, 2019 Bonjour, J'aurai besoin de votre aide SVP concernant un souci de chargement sur un slider OWL CAROUSEL, Quand je charge le site le slider affiche un height de 1444psx alors que mes image ne dépasse pas 387px, ci-joint une C.E Je partage avec vous le code de mon slider * ---------------------------------------- THEME SLIDER ---------------------------------------- */ $(function() { if ($('#slider-container').length) { $('#slider-container').owlCarousel({ items: 1, loop: true, lazyLoad: true, autoHeight: true, animateOut: pte_slideranimateout, animateIn: pte_slideranimatein, autoplay: pte_sliderautoscroll, autoplayTimeout: pte_sliderspeed + 4000, autoplayHoverPause: true, smartSpeed: pte_sliderspeed, nav: true, navContainer: '.slider-nav', navText: ['‹', '›'], dots: true, dotsContainer: '.slider-dots' }); $('#slider-container').find('.cloned').find('h1').remove(); $('#slider-container').on('translate.owl.carousel', function(e) { $(this).find('.slider-caption').fadeOut('fast').removeClass('animated ' + pte_captionanimation); }); $('#slider-container').on('translated.owl.carousel', function(e) { $(this).find('.active').find('.slider-caption').fadeIn('slow').addClass('animated ' + pte_captionanimation); }); function sliderAutoHeight() { var imgHeight = $('#slider-container').find('.active img').height(); $('#slider-container').css('height', imgHeight + 'px'); } $('#slider-container').find('.active img').load(function() { sliderAutoHeight(); }); $('#slider-container').on('translate.owl.carousel', function(e) { setTimeout(sliderAutoHeight, 100); }); } }); <div id="theme-slider" class="clear float-left w-100"> {if $pte_sliderpagination}<div class="slider-dots owl-dots"></div>{/if} <div id="slider-container" class="owl-carousel"> {foreach from=$slides item=slide name=slides} <div class="slider-slide"> {if $slide.link && $pte_sliderlink}<a href="{$slide.link}">{/if} <img src="about:blank" data-src="{$urls.img_url}slide-img-{$slide.id}-{$id_shop}-{$id_lang}.png" alt="{$slide.title}" class="owl-lazy mx-auto d-block" {if isset($slide.size) && $slide.size} {$slide.size nofilter} {/if}> {if $slide.link && $pte_sliderlink}</a>{/if} {if $pte_slidercaption} <div class="slider-caption"> {if $smarty.foreach.slides.first}<h1 class="slider-title mb-0">{$slide.title}</h1>{else}<p class="slider-title">{$slide.title}</p>{/if} {if $slide.subtitle}<p class="slider-subtitle mt-1 hidden-xs-down">{$slide.subtitle}</p>{/if} {if $slide.resume}<p class="slider-resume hidden-md-down">{$slide.resume nofilter}</p>{/if} {if $slide.link && !$pte_sliderlink}<a href="{$slide.link}" class="btn btn-primary mt-2 mt-xl-3">{l s='View more' d='Shop.CreathemeGlobal'}</a>{/if} </div> {/if} </div> {/foreach} </div> {if $pte_sliderarrows}<div class="slider-nav owl-nav"></div>{/if} </div> <script> var pte_sliderautoscroll = {$pte_sliderautoscroll}; var pte_slideranimateout = "{$pte_slideranimateout}"; var pte_slideranimatein = "{$pte_slideranimatein}"; var pte_captionanimation = "{$pte_captionanimation}"; var pte_sliderspeed = {$pte_sliderspeed}; </script> /* ---------------------------------------- * OWL CAROUSEL v2.2.1 * Copyright (c) 2013-2017 David Deutsch * Licensed under MIT license ---------------------------------------- */ .owl-carousel { .transition(height 500ms ease-in-out); display: none; overflow: hidden; -webkit-tap-highlight-color: transparent; } .owl-carousel .owl-stage { position: relative; -ms-touch-action: pan-Y; .clearfix(); } .owl-carousel .owl-stage-outer { position: relative; overflow: hidden; -webkit-transform: none; } .owl-carousel .owl-wrapper, .owl-carousel .owl-item { .backfaceVisibility(hidden); -webkit-transform: none; } .owl-carousel .owl-item { position: relative; float: left; min-height: 1px; -webkit-backface-visibility: hidden; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; } .owl-carousel.owl-loaded { display: block; } .owl-carousel.owl-loading { opacity: 0; display: block; } .owl-carousel.owl-hidden { opacity: 0; } .owl-carousel.owl-refresh .owl-item { visibility: hidden; } .owl-carousel.owl-drag .owl-item { .userSelect(none); } .owl-carousel.owl-grab { cursor: move; cursor: grab; } .no-js .owl-carousel { display: block; } .owl-carousel .owl-animated-in { z-index: 0; } .owl-carousel .owl-animated-out { z-index: 1; } .owl-height { .transition(height 500ms ease-in-out); } .owl-carousel .owl-item .owl-lazy { .transition(opacity 400ms ease); opacity: 0; } .owl-carousel .owl-item img.owl-lazy { -webkit-transform-style: preserve-3d; transform-style: preserve-3d; } .owl-nav { -webkit-tap-highlight-color: transparent; &.disabled { display: none; } .owl-prev, .owl-next { .translate(0, -50%); position: absolute; top: 50%; color: @baseFontColor; font: 700 50px/1 'Times New Roman', sans-serif; cursor: pointer; z-index: 1; .userSelect(none); } .owl-prev { left: 0; } .owl-next { right: 0; } .disabled { opacity: 0.2; cursor: default; } } .owl-dots { position: absolute; top: 12px; left: 12px; right: 12px; text-align: center; z-index: 1; -webkit-tap-highlight-color: transparent; &.disabled { display: none; } .owl-dot { display: inline-block; cursor: pointer; .userSelect(none); span { background-color: lighten(@baseFontColor, 25%); border-radius: 50%; .boxShadow(inset 0 2px 2px rgba(0, 0, 0, 0.5)); display: block; width: 14px; height: 14px; margin: 0 0.2rem; -webkit-backface-visibility: visible; } &.active { cursor: default; } &.active span, &:hover span { background-color: @baseFontColor; } } } https://drive.google.com/file/d/1lJr6ARyXQt5ZatVBwmT143u3UZ_kGp-B/view Je vous remercie d'avance pour votre aide Cordialement, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now