Skip to content

Instantly share code, notes, and snippets.

@MichaelDimmitt
Last active April 15, 2023 12:00
Show Gist options
  • Select an option

  • Save MichaelDimmitt/9f5a0e6b2077733c86d3cb11185ee13d to your computer and use it in GitHub Desktop.

Select an option

Save MichaelDimmitt/9f5a0e6b2077733c86d3cb11185ee13d to your computer and use it in GitHub Desktop.
Just look at the pictures

Just look at the pictures

https://leanpub.com/javascriptallongesix/read

document.getElementsByTagName('figcaption')[14].scrollIntoView()

document.getElementsByTagName('blockquote')[12]

sometimes a book goes over your head,

sometimes I just look at the pictures

(function loop(index) {
  setTimeout(() => {
      
    // Your logic here
    index = index+1
      document.getElementsByTagName('figcaption')[index].scrollIntoView()
      console.log({index})
    if(index < 40) {
      loop(index);
    }
  }, 1000);
})(-1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment