Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    VoidVolker
    @VoidVolker
    slides - is array, and i is index
    for eaxmple: slides = [slideOne, slideTwo, slideThree]
    AnaCamelo
    @AnaCamelo
    So, here:
    for (i = 0; i < slides.length; i++) {
    slides[i].style.display = "none";
    }
    it is saying to hide ALL the slides? what about the one that is being displayed?
    it is a bit confusing to me. Thank you for answering @VoidVolker :)
    VoidVolker
    @VoidVolker
    yes. correct, this will hide all slides
    also, it is better to cache slides.length to separate variable
    AnaCamelo
    @AnaCamelo
    so, how is that one of the slides is being showed?
    VoidVolker
    @VoidVolker
    add code to show selected slide?
    AnaCamelo
    @AnaCamelo
    well, the code is working great, but i don't understand why if that loop is hiding all the slides, how is one being displayed?
    VoidVolker
    @VoidVolker
    in this loop no one slide is being displayed
    AnaCamelo
    @AnaCamelo
    exactly, that's why I'm confused
    VoidVolker
    @VoidVolker
    check other code
    AnaCamelo
    @AnaCamelo
    Can i show you athe whole code?
    VoidVolker
    @VoidVolker
    this loop isnt the place for searching the displayed slide
    use ``` for code
    before and after
    AnaCamelo
    @AnaCamelo
    oohh ok, thanks! :)

    ' var slideIndex = 1;
    showSlides(slideIndex);

    function plusSlides(n) {
    showSlides(slideIndex += n);
    }

    function currentSlide(n) {
    showSlides(slideIndex = n);
    }

    function showSlides(n) {
    var i;
    var slides = document.getElementsByClassName("mySlides");
    var dots = document.getElementsByClassName("dot");
    if (n > slides.length) {slideIndex = 1}
    if (n < 1) {slideIndex = slides.length}
    for (i = 0; i < slides.length; i++) {
    slides[i].style.display = "none";
    }
    for (i = 0; i < dots.length; i++) {
    dots[i].className = dots[i].className.replace(" active", "");
    }
    slides[slideIndex-1].style.display = "block";
    dots[slideIndex-1].className += " active";
    }'

    single quotation mark for the code? it didn't seem to work
    VoidVolker
    @VoidVolker
    wrooong style! use ``` for code wrapping
    not single quotation, three apostrophe
    AnaCamelo
    @AnaCamelo
    k
    VoidVolker
    @VoidVolker
    @AnaCamelo edit your msg for correct style
    @AnaCamelo you can edit your msg, please don't flood
    AnaCamelo
    @AnaCamelo
    sorry, I'm trying
    VoidVolker
    @VoidVolker
    code isn't redable, fix style before for more redaible view
    AnaCamelo
    @AnaCamelo
    ok
    VoidVolker
    @VoidVolker
    var slideIndex = 1;
    showSlides(slideIndex);
    
    function plusSlides(n) {
        showSlides(slideIndex += n);
    }
    
    function currentSlide(n) {
        showSlides(slideIndex = n);
    }
    
    function showSlides(n) {
    
        var i;    
        var slides = document.getElementsByClassName("mySlides");
        var dots = document.getElementsByClassName("dot");
    
        if (n > slides.length) {slideIndex = 1}
        if (n < 1) {slideIndex = slides.length}
    
        for (i = 0; i < slides.length; i++) {
            slides[i].style.display = "none";
        }
    
        for (i = 0; i < dots.length; i++) {
            dots[i].className = dots[i].className.replace(" active", "");
        }
    
        slides[slideIndex-1].style.display = "block";
        dots[slideIndex-1].className += " active";
    }
    AnaCamelo
    @AnaCamelo
    I can't make it work :S
    VoidVolker
    @VoidVolker
    like this
    new line after ```
    AnaCamelo
    @AnaCamelo
    var slideIndex = 1;
    showSlides(slideIndex);
    
    function plusSlides(n) {
      showSlides(slideIndex += n);
    }
    
    function currentSlide(n) {
      showSlides(slideIndex = n);
    }
    
    function showSlides(n) {
      var i;
      var slides = document.getElementsByClassName("mySlides");
      var dots = document.getElementsByClassName("dot");
      if (n > slides.length) {slideIndex = 1} 
      if (n < 1) {slideIndex = slides.length}
      for (i = 0; i < slides.length; i++) {
          slides[i].style.display = "none"; 
      }
      for (i = 0; i < dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "block"; 
      dots[slideIndex-1].className += " active";
    }
    there you go! :)
    thank you!
    VoidVolker
    @VoidVolker
    cool ) grac :+1:
    check the string slides[slideIndex-1].style.display = "block";
    @AnaCamelo
    this is what you are lokking for
    AnaCamelo
    @AnaCamelo
    The script i have is working well, i just want to understand it
    VoidVolker
    @VoidVolker
    goog, so, this string is show current slide
    AnaCamelo
    @AnaCamelo
    oohhh ok.. i think i get it
    thanks a lot @VoidVolker
    mohamadabab
    @mohamadabab
    hello
    any one can help me
    VoidVolker
    @VoidVolker
    just asq
    mohamadabab
    @mohamadabab
    i have master project and i want to programme a web template in this web anyone can create your simple mobile application like this web http://www.appsgeyser.com
    my questions is how i start
    satrapes
    @satrapes
    can anyone help me understand a few key details on asynchronous communication between host and embedded device over USB?
    satrapes
    @satrapes
    ...
    EligijusB
    @EligijusB
    Hey guys, I am new here, having some problems with Selenium in Java using HTMLUnitDriver. Can anyone help?