⟨BACK

logo

APP✓
how to create a responsive slideshow with CSS and JavaScript « Hypesloaded

how to create a responsive slideshow with CSS and JavaScript



View Comment

Posted By: olamilekan

On

Learn how to create a responsive slideshow with CSS and JavaScript. Slideshow / Carousel A slideshow is used to cycle through elements copy codes below an enjoy firstly add a view port <textarea><meta name="viewport" content="width=device-width, initial-scale=1"></textarea><textarea> <style> * {box-sizing: border-box} body {font-family: Verdana, sans-serif; margin:0} .mySlides {display: none} img {vertical-align: middle;} /* Slideshow container */ .slideshow-container { max-width: 1000px; position: relative; margin: auto; } /* Next & previous buttons */ .prev, .next { cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px; margin-top: -22px; color: white; font-weight: bold; font-size: 18px; transition: 0.6s ease; border-radius: 0 3px 3px 0; user-select: none; } /* Position the "next button" to the right */ .next { right: 0; border-radius: 3px 0 0 3px; } /* On hover, add a black background color with a little bit see-through */ .prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); } /* Caption text */ .text { color: #f2f2f2; font-size: 15px; padding: 8px 12px; position: absolute; bottom: 8px; width: 100%; text-align: center; } /* Number text (1/3 etc) */ .numbertext { color: #f2f2f2; font-size: 12px; padding: 8px 12px; position: absolute; top: 0; } /* The dots/bullets/indicators */ .dot { cursor: pointer; height: 15px; width: 15px; margin: 0 2px; background-color: #bbb; border-radius: 50%; display: inline-block; transition: background-color 0.6s ease; } .active, .dot:hover { background-color: #717171; } /* Fading animation */ .fade { -webkit-animation-name: fade; -webkit-animation-duration: 1.5s; animation-name: fade; animation-duration: 1.5s; } @-webkit-keyframes fade { from {opacity: .4} to {opacity: 1} } @keyframes fade { from {opacity: .4} to {opacity: 1} } /* On smaller screens, decrease text size */ @media only screen and (max-width: 300px) { .prev, .next,.text {font-size: 11px} } </style> </textarea> put this in body area <textarea> <div class="slideshow-container"> <div class="mySlides fade"> <div class="numbertext">1 / 3</div> <img src="img_nature_wide.jpg" style="width:100%"> <div class="text">Caption Text</div> </div> <div class="mySlides fade"> <div class="numbertext">2 / 3</div> <img src="img_snow_wide.jpg" style="width:100%"> <div class="text">Caption Two</div> </div> <div class="mySlides fade"> <div class="numbertext">3 / 3</div> <img src="img_mountains_wide.jpg" style="width:100%"> <div class="text">Caption Three</div> </div> <a class="prev" onclick="plusSlides(-1)">&#10094;</a> <a class="next" onclick="plusSlides(1)">&#10095;</a> </div> <br> <div style="text-align:center"> <span class="dot" onclick="currentSlide(1)"></span> <span class="dot" onclick="currentSlide(2)"></span> <span class="dot" onclick="currentSlide(3)"></span> </div> <script> var slideIndex = 1; showSlides(slideIndex); function plusSlides(n) { showSlides(slideIndex += n); } function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName("mySlides"); var dots = document.getElementsByClassName("dot"); if (n > slides.length) {slideIndex = 1} if (n < 1) {slideIndex = slides.length} for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " active"; } </script> </textarea>








WATCH VIDEO BELOW;

. Added By olamilekan

ADS CLICK Here For Fast Download
Rates:

Tags


Please Don't Forget To Like, Share Or Leave A Comment

Comment chat
#Copy Topic Title / Link For Social Repost
HL Articles You Might Also like!!
HL Article Comments!!
Recent Comments
Anonymous
Hmm.. Super Cool Reply
13 hours ago


No Commnent From You Yet @This Hour Kindly Be The First To Drop A Comment @This Hour !! and Earn Money On Hypesloaded
Leave a comment Refresh
Don't Spam Okay?
Write A Comment Below



Now Showing Video

ADEKUNLE GOLD – PICK UP VIDEO (PROD. PHEELZ)

LIKE AUDIO DOWNLOAD

HL Sponsored Ads

SITE-SEARCH

FUNNY TRIVIA!
Advertise With Anonymous Ads Cast Your Music, Videos & More!
See Legit way to Get Free BTC In Crypto Know Stress!
See Legit way to Get All Sim Card Network Cheats !

HL Top Featured Acts, Storys & Artistes.
See Legit way to See Legit way to See Legit way to See Legit way to See Legit way to
artistslist
★Olajibson ★
artistslist
★Burna Boy★
artistslist
★Asake★
artistslist
★Davido
artistslist
★Wizkid
artistslist
★Phyno
artistslist
★Naira Marley
artistslist
★Olamide
artistslist
★Tiwa Savage ★
artistslist
★Zlatan ★
artistslist
★Kizz Daniel ★
artistslist
★Simi ★
artistslist
★OmotayoOT ★
artistslist
★Tekno★
artistslist
★Yemi alade ★
artistslist
★Joeboy ★
artistslist
★Oxlade ★
artistslist
★ Portable ★
artistslist
★ Mobad★
artistslist
★ Rema ★
artistslist
★ Ruger ★
artistslist
★ falz★
Vikimic

Vikimic

Guest

Guest

Jimmy D Psalmist – This
Can Only Be God Ft. Moses
Bliss
Jimmy D Ps
Tyler ICU – Ngimoja Ft.
Khanyisa, Tumelo.za &
Tyrondee
Tyler ICU
DJ Cora – Tinubu Beat
DJ Cora –
DJ Cora – Elu P
DJ Cora –
YKB – Bo Card (Things I
Need)
YKB – Bo C
DJ Yk Mule – Ellu P Obi
Dance
DJ Yk Mule
DJ Cora – Leg Work
Beat
DJ Cora –
DJ Cora – No Money No
Fuel No Water
DJ Cora –
DanDizzy – Your Papa
DanDizzy –
DarkoVibes – Happy Day
(Amapiano Remix) Ft.
2woBunnies
DarkoVibes
Portable – Omo Olohun
Wahala
Portable –
Phina – Rara Ft. Jux
Phina – Ra
Micee – Excuse Me Ft. Naira
Marley
Micee – Ex
JayLon – FIREDNCR
(Amapiano Remix) Ft.
Ozedikus & Azanti
JayLon – F
Mr Brown – Moshomo
Ft. Kabza De Small
Mr Brown –
Makhadzi – Tsini Tsini Ft.
Fortunator & Mash K
Makhadzi –
Spyro – Who Is Your Guy
(Remix) Ft. Tiwa Savage
Spyro – Wh
Dreamville – Ogogoro Ft.
Bas & Ayra Starr
Dreamville
Major Lazer – Designer Ft.
Major League Djz & Joeboy
Major Laze
Isabella Smallkhid

Isabella S

inbound2094195360969057921

inbound209

58

58

AKPVIBES

AKPVIBES

Beautiful

Beautiful

HL Site Statistics
HL Archived Pages Lists !

SELL YOUR STUFFS | ADVERTISE HERE | TOS | CONTACT US | DISCLAIMER | AFFILIATE PROGRAMS | WHATSAPP | EARN WITH OUR SURVEY!
| Sitemap
English (UK) Powered By Olajibson™ GOTO UP+
HelpReport a Problem
Settings & PrivacyTerms & Policies
©opyRight 2023 hypesloaded.top
Clicky