Skip to main content
Inspiring
December 4, 2017
Question

control transition color in an img slider?

  • December 4, 2017
  • 1 reply
  • 295 views

The transitional color overlay that helps fade in each image in a slider happens to be a dark gray. I am unsure how I can adapt that to be white.

.slider {

  padding-bottom: 0;

  margin-bottom: -1px;

  background: #ffffff;

  border: none;

  box-shadow: none;

}

<script>

var slideIndex = 0;

showSlides();

function showSlides() {

    var i;

    var slides = document.getElementsByClassName("slider");

    var dots = document.getElementsByClassName("dot");

    for (i = 0; i < slides.length; i++) {

       slides.style.display = "none"; 

    }

    slideIndex++;

    if (slideIndex > slides.length) {slideIndex = 1}   

    for (i = 0; i < dots.length; i++) {

        dots.className = dots.className.replace(" dotActive", "");

    }

    slides[slideIndex-1].style.display = "block"; 

    dots[slideIndex-1].className += " dotActive";

    setTimeout(showSlides, 6000); // Change image every 6 seconds

}

</script>

Not even sure where it is pulling the gray color in. Any recommendations I will try.

Thanks.

    This topic has been closed for replies.

    1 reply

    BenPleysier
    Community Expert
    Community Expert
    December 4, 2017

    Sorry, as long as you persist in showing us just parts of your code, I will not even bother to answer.

    In the above, I can only assume that there are style rules within the class names of dot and dotActive, code that we are not privvy to.

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!