1<!--automatic slidshow-->
2
3<!DOCTYPE html>
4<html>
5<head>
6<meta name="viewport" content="width=device-width, initial-scale=1">
7<style>
8* {box-sizing: border-box;}
9body {font-family: Verdana, sans-serif;}
10.mySlides {display: none;}
11img {vertical-align: middle;}
12
13/* Slideshow container */
14.slideshow-container {
15 max-width: 1000px;
16 position: relative;
17 margin: auto;
18}
19
20/* Caption text */
21.text {
22 color: #f2f2f2;
23 font-size: 15px;
24 padding: 8px 12px;
25 position: absolute;
26 bottom: 8px;
27 width: 100%;
28 text-align: center;
29}
30
31/* Number text (1/3 etc) */
32.numbertext {
33 color: #f2f2f2;
34 font-size: 12px;
35 padding: 8px 12px;
36 position: absolute;
37 top: 0;
38}
39
40/* The dots/bullets/indicators */
41.dot {
42 height: 15px;
43 width: 15px;
44 margin: 0 2px;
45 background-color: #bbb;
46 border-radius: 50%;
47 display: inline-block;
48 transition: background-color 0.6s ease;
49}
50
51.active {
52 background-color: #717171;
53}
54
55/* Fading animation */
56.fade {
57 -webkit-animation-name: fade;
58 -webkit-animation-duration: 1.5s;
59 animation-name: fade;
60 animation-duration: 1.5s;
61}
62
63@-webkit-keyframes fade {
64 from {opacity: .4}
65 to {opacity: 1}
66}
67
68@keyframes fade {
69 from {opacity: .4}
70 to {opacity: 1}
71}
72
73/* On smaller screens, decrease text size */
74@media only screen and (max-width: 300px) {
75 .text {font-size: 11px}
76}
77</style>
78</head>
79<body>
80
81<h2>Automatic Slideshow</h2>
82<p>Change image every 2 seconds:</p>
83
84<div class="slideshow-container">
85
86<div class="mySlides fade">
87 <div class="numbertext">1 / 3</div>
88 <img src="img_nature_wide.jpg" style="width:100%">
89 <div class="text">Caption Text</div>
90</div>
91
92<div class="mySlides fade">
93 <div class="numbertext">2 / 3</div>
94 <img src="img_snow_wide.jpg" style="width:100%">
95 <div class="text">Caption Two</div>
96</div>
97
98<div class="mySlides fade">
99 <div class="numbertext">3 / 3</div>
100 <img src="img_mountains_wide.jpg" style="width:100%">
101 <div class="text">Caption Three</div>
102</div>
103
104</div>
105<br>
106
107<div style="text-align:center">
108 <span class="dot"></span>
109 <span class="dot"></span>
110 <span class="dot"></span>
111</div>
112
113<script>
114var slideIndex = 0;
115showSlides();
116
117function showSlides() {
118 var i;
119 var slides = document.getElementsByClassName("mySlides");
120 var dots = document.getElementsByClassName("dot");
121 for (i = 0; i < slides.length; i++) {
122 slides[i].style.display = "none";
123 }
124 slideIndex++;
125 if (slideIndex > slides.length) {slideIndex = 1}
126 for (i = 0; i < dots.length; i++) {
127 dots[i].className = dots[i].className.replace(" active", "");
128 }
129 slides[slideIndex-1].style.display = "block";
130 dots[slideIndex-1].className += " active";
131 setTimeout(showSlides, 2000); // Change image every 2 seconds
132}
133</script>
134
135</body>
136</html>
1
2<input className="newpost-rating-slider" type="range" name="rangeInput"
3min="0" max="5" onChange={handleSliderRating} />
4
5<span className="slider-rating-field">0/5</span>
6
7
8
9const handleSliderRating = () => {
10
11 var curVal = document.querySelector('.newpost-rating-slider').value;
12 var sliderRatingEle = document.querySelector('.slider-rating-field');
13
14 sliderRatingEle.textContent = curVal.toString() + "/5";
15
16 }
1<!DOCTYPE html>
2<html>
3<title>W3.CSS</title>
4<meta name="viewport" content="width=device-width, initial-scale=1">
5<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
6<style>
7.mySlides {display:none;}
8</style>
9<body>
10
11<h2 class="w3-center">Manual Slideshow</h2>
12
13<div class="w3-content w3-display-container">
14 <img class="mySlides" src="img_snowtops.jpg" style="width:100%">
15 <img class="mySlides" src="img_lights.jpg" style="width:100%">
16 <img class="mySlides" src="img_mountains.jpg" style="width:100%">
17 <img class="mySlides" src="img_forest.jpg" style="width:100%">
18
19 <button class="w3-button w3-black w3-display-left" onclick="plusDivs(-1)">❮</button>
20 <button class="w3-button w3-black w3-display-right" onclick="plusDivs(1)">❯</button>
21</div>
22
23<script>
24var slideIndex = 1;
25showDivs(slideIndex);
26
27function plusDivs(n) {
28 showDivs(slideIndex += n);
29}
30
31function showDivs(n) {
32 var i;
33 var x = document.getElementsByClassName("mySlides");
34 if (n > x.length) {slideIndex = 1}
35 if (n < 1) {slideIndex = x.length}
36 for (i = 0; i < x.length; i++) {
37 x[i].style.display = "none";
38 }
39 x[slideIndex-1].style.display = "block";
40}
41</script>
42
43</body>
44</html>
45