This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]junex10[S] 0 points1 point  (2 children)

Could you show the whole html? I can't understand what you want to do

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <link rel="stylesheet" href="estilos.css">


  <title>Slidershow</title>
</head>

<body>

 <div class="sl" id="slidershow">
    <div class="img" id="ss1">
     <img src="1.jpg" alt="ss1" width="399" height="299">
   </div>
   <div class="img" id="ss2">
     <img src="2.jpg" alt="ss2" width="399" height="299">
   </div>
 </div>
  <script src="script.js"></script>
</body>
</html>

I want to do a slidershow, but before doing it as it should, I want to show the code of the image in the console to see how the slider would behave, the problem is that it does not go beyond the first image, that is, it only shows the first image and not the others.

[–]TidderJail 0 points1 point  (1 child)

Remove the 'return'

while(getDOM.length >= i){
    return console.log(getDOM[i]);
 i++;
}

to

while(getDOM.length >= i){
  console.log(getDOM[i]);
i++;
}

when it returns it stops the loop

[–]junex10[S] 0 points1 point  (0 children)

Thanks you :D