轮播是一个循环的幻灯片:
以下实例创建了一个简单的图片轮播效果 :
<
div
id
=
"
demo
"
class
=
"
carousel slide
"
data-ride
=
"
carousel
"
>
<
ul
class
=
"
carousel-indicators
"
>
<
li
data-target
=
"
#demo
"
data-slide-to
=
"
0
"
class
=
"
active
"
>
li
>
<
li
data-target
=
"
#demo
"
data-slide-to
=
"
1
"
>
li
>
<
li
data-target
=
"
#demo
"
data-slide-to
=
"
2
"
>
li
>
ul
>
<
div
class
=
"
carousel-inner
"
>
<
div
class
=
"
carousel-item active
"
>
<
img
decoding
=
"
async
"
src
=
"
https://static.cdccxhl.com/images/mix/img_fjords_wide.jpg
"
>
div
>
<
div
class
=
"
carousel-item
"
>
<
img
decoding
=
"
async
"
src
=
"
https://static.cdcxhl.com/images/mix/img_nature_wide.jpg
"
>
div
>
<
div
class
=
"
carousel-item
"
>
<
img
decoding
=
"
async
"
src
=
"
https://static.cdcxhl.com/images/mix/img_mountains_wide.jpg
"
>
div
>
div
>
<
a
class
=
"
carousel-control-prev
"
href
=
"
#demo
"
data-slide
=
"
prev
"
>
<
span
class
=
"
carousel-control-prev-icon
"
>
span
>
a
>
<
a
class
=
"
carousel-control-next
"
href
=
"
#demo
"
data-slide
=
"
next
"
>
<
span
class
=
"
carousel-control-next-icon
"
>
span
>
a
>
div
>
尝试一下 »
在每个