Flexslider - Loading with still images

Asked

Viewed 91 times

0

I’m using Flexslider, but while the images load and the function is not executed, it plays one image under the other, generating a huge scroll bar and, after the execution and loading of the images, it performs normally.

The question is: Is there any way to keep the images in the same position one below the other before they load? not to generate this huge scrollbar.

Follows code:

html:

  <div class="sliderTrabalhe" ng-init="vm.sliderTrabalhe();">
     <ul class="slides">
      <li ng-repeat="s in vm.repeat(7) track by $index">
        <div class="image" style="background-image: url('app/template/img/slider.jpg');"></div>
      </li>
     </ul>
  </div> 

Function:

vm.sliderTrabalhe = function () {
     setTimeout(function () {
       $('.sliderTrabalhe').flexslider({
       animation: "slide",
       controlNav: true
     });
   }, 1000);
 }

CSS:

.sliderTrabalhe{
    position: relative;
    margin-bottom: 70px;
    @extend .largura_total;
    height: 500px;
    .image{
        height: 500px;
    }
    .flex-control-nav{
        bottom: -30px;
        left: 50px;
    }
    .flex-control-paging li a{
        background: $cinza_escuro!important; 
    }
    .flex-control-paging li a.flex-active{
        background: $vermelho!important; 
        width: 15px;
        height: 15px;
        padding-top: 2px;
    }
    .flex-control-nav li {
        margin: 0 3px; 
    }
}

Follow images for better understanding:

Before: inserir a descrição da imagem aqui Afterward: inserir a descrição da imagem aqui

1 answer

0


CSS to load still images:

.sliderTrabalhe {
  margin: 0;
  padding: 0;
}
.sliderTrabalhe .slides > li {
  display: none;
  -webkit-backface-visibility: hidden;
}
.sliderTrabalhe .slides img {
  width: 100%;
  display: block;
}
.sliderTrabalhe .slides:after {
  content: "\0020";
  display: block;
  clear: both;
  visibility: hidden;
  line-height: 0;
  height: 0;
}
html[xmlns] .sliderTrabalhe .slides {
  display: block;
}
* html .sliderTrabalhe .slides {
  height: 1%;
}
.no-js .sliderTrabalhe .slides > li:first-child {
  display: block;
}
.sliderTrabalhe {
  position: relative;
  zoom: 1;
}
.sliderTrabalhe .slides {
  zoom: 1;
}
.sliderTrabalhe .slides img {
  height: auto;
  -moz-user-select: none;
}
.sliderTrabalhe:hover .flex-direction-nav .flex-prev {
  opacity: 0.7;
  left: -20px;
}
.sliderTrabalhe:hover .flex-direction-nav .flex-prev:hover {
  opacity: 1;
}
.sliderTrabalhe:hover .flex-direction-nav .flex-next {
  opacity: 0.7;
  right: -20px;
}
.sliderTrabalhe:hover .flex-direction-nav .flex-next:hover {
  opacity: 1;
}

.sliderTrabalhe .flex-direction-nav a{
  width: 19px;
  height: 32px;
  margin: 0;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.