2 ms·
A div with an id of 'slideshow' contains five images, the first of which is shown and the others are hidden using a display style of none. Using Javascript, cre
by jhpriestley 16y ago
A div with an id of 'slideshow' contains five images, the first of which is shown and the others are hidden using a display style of none. Using Javascript, create a simple slideshow that cycles through the images, displaying each image for three seconds at a time, looping back to the first image when the end is reached. You cannot use jQuery or any other library.
Instead of asking something easy, with a completely unrealistic caveat that makes it tricky for people who think that the "library" was actually a positive invention, why not ask something not easy.
It sounds like you're looking for people who spend their time writing garbage like
while(node = node.parentNode){
if(node.className.match(/foo/)) {
break;
}
}
because `node.closest('.foo')` isn't hardcore enough. That sounds like a crap engineer to me.
- Isofarro 16y agoThe point of understanding the fundamentals of DOM means being able to adapt when the library abstraction you are using leaks. We are not in a state where libraries have effectively or completely abstracted DOM and BOM, so sometimes seeing past the library is necessary. With developers who can't tell the difference between jQuery and JavaScript + DOM, that is a barrier to being an effective developer.