Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Initializing Your First Swiper | Getting Started with Swiper
Quizzes & Challenges
Quizzes
Challenges
/
JavaScript Swiper JS Slider Development

bookInitializing Your First Swiper

index.html

index.html

script.js

script.js

copy

To bring your first Swiper slider to life, you begin by building the HTML structure. The main container uses the swiper class, and the slides are placed inside a swiper-wrapper element. Each slide is represented by a swiper-slide element. This structure tells Swiper which elements make up the slider and its slides.

Once your HTML is set up, you need to connect the Swiper JavaScript library. You do this by adding a <script> tag that loads Swiper from a CDN, followed by your own script.js file. In your JavaScript file, you initialize Swiper by creating a new instance and passing the selector for your slider container. This step activates the slider and makes it interactive. Without this initialization step, the slider will not function—the slides will simply be stacked on the page without any sliding behavior. The default Swiper settings will enable basic sliding right away, and you can customize the behavior later as you learn more.

question mark

What is required to make a Swiper slider functional after setting up the HTML structure?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 3

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

bookInitializing Your First Swiper

Deslize para mostrar o menu

index.html

index.html

script.js

script.js

copy

To bring your first Swiper slider to life, you begin by building the HTML structure. The main container uses the swiper class, and the slides are placed inside a swiper-wrapper element. Each slide is represented by a swiper-slide element. This structure tells Swiper which elements make up the slider and its slides.

Once your HTML is set up, you need to connect the Swiper JavaScript library. You do this by adding a <script> tag that loads Swiper from a CDN, followed by your own script.js file. In your JavaScript file, you initialize Swiper by creating a new instance and passing the selector for your slider container. This step activates the slider and makes it interactive. Without this initialization step, the slider will not function—the slides will simply be stacked on the page without any sliding behavior. The default Swiper settings will enable basic sliding right away, and you can customize the behavior later as you learn more.

question mark

What is required to make a Swiper slider functional after setting up the HTML structure?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 3
some-alt