Chapter 4. Understanding Slider Performance

The Slider Works Before Its Script Does

SwiftSlider builds the slider in the page's HTML on your server, not in the visitor's browser. The first slide, with its heading, text and button, is visible and usable as soon as the page appears, even if the visitor's browser is slow to run scripts or has them switched off. This approach is called progressive enhancement: the page works first, and the script makes it better.

The script waits until the browser has finished its most urgent work, then adds, as needed:

  • the previous and next buttons and the dots

  • the transitions and effects

  • loading of the other slides' images

  • keyboard navigation

  • swiping, on touchscreens only

  • autoplay, if you switched it on

Each of these is a separate small file that is downloaded only when the slider needs it. A desktop visitor never downloads the swipe code, and a slider without autoplay never downloads the autoplay code.