HTML - controles deslizantes de rango

 
Vista:
sin imagen de perfil
Val: 3
Ha disminuido su posición en 20 puestos en HTML (en relación al último mes)
Gráfica de HTML

controles deslizantes de rango

Publicado por Ness (3 intervenciones) el 08/01/2019 21:28:26
Teniendo este código, quiero que si deslizas la barra hacia la izquierda, el interlineado suba y si lo desplazas hacia la izquierda, este baje. Muchas gracias de antemano


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.slidecontainer {
  width: 100%;
}
 
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 25px;
  background: #d3d3d3;
  outline: none;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
}
 
.slider:hover {
  opacity: 1;
}
 
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 25px;
  height: 25px;
  background: #4CAF50;
  cursor: pointer;
}
 
.slider::-moz-range-thumb {
  width: 25px;
  height: 25px;
  background: #4CAF50;
  cursor: pointer;
}
</style>
</head>
<body>
 
 
<p>The line-height Property
line-height: normal (default):
This is a paragraph with a standard line-height.
The standard line height in most browsers is about 110% to 120%.
line-height: 1.6 (recommended):
This is a paragraph with the recommended line-height.
The line height is here set to 1.6. This is a unitless value;
meaning that the line height will be relative to the font size.
line-height: 80%:
This is a paragraph with a smaller line-height.
The line height is here set to 80%.
line-height: 200%:
This is a paragraph with a bigger line-height.
The line height is here set to 200%.</p>
 
<div class="slidecontainer">
  <input type="range" min="1" max="100" value="50" class="slider" id="myRange">
  <p>Value: <span id="demo"></span></p>
</div>
 
<script>
var slider = document.getElementById("myRange");
var output = document.getElementById("demo");
output.innerHTML = slider.value;
 
slider.oninput = function() {
  output.innerHTML = this.value;
}
</script>
 
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Alejandro
Val: 247
Bronce
Ha mantenido su posición en HTML (en relación al último mes)
Gráfica de HTML

controles deslizantes de rango

Publicado por Alejandro (100 intervenciones) el 09/01/2019 15:56:38
  • Alejandro se encuentra ahora conectado en el
  • chat de PHP
Agrega un id al párrafo y cambia el style cuando se mueva la barra
1
2
3
4
<p id="texto">...</p>
...
...
document.getElementById('texto').style.lineHeight=nuevoValor
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar