1
Hello, I need to create two buttons that have the same function as a scroll, but without bar, I want to click and hold the button down the page, and when just a click, scroll down the page.
The same should be done in javascript and can use at most a Jquery.
I appreciate anyone who can help.
Follow the prototype below:
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Aparecida Nutrição</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body>
<header>
<div class="container">
<h1 class="teste">Aparecida Nutrição</h1>
</div>
</header>
<div><div>
<main>
<button id="up">Up</button>
<button id="down">Down</button>
<section style="overflow: auto; height: 300px;" class="container">
<h2>Meus pacientes</h2>
<href class="scroll"/>
<table >
<thead>
<tr>
<th>Nome</th>
<th>Peso(kg)</th>
<th>Altura(m)</th>
<th>Gordura Corporal(%)</th>
<th>IMC</th>
</tr>
<tr class="paciente" >
<td class="info-nome">Paulo</td>
<td class="info-peso">100</td>
<td class="info-altura">2.00</td>
<td class="info-gordura">10</td>
<td class="info-imc">0</td>
</tr>
<tr class="paciente" >
<td class="info-nome">João</td>
<td class="info-peso">80</td>
<td class="info-altura">1.72</td>
<td class="info-gordura">40</td>
<td class="info-imc">0</td>
</tr>
<tr class="paciente" >
<td class="info-nome">Erica</td>
<td class="info-peso">54</td>
<td class="info-altura">1.64</td>
<td class="info-gordura">14</td>
<td class="info-imc">0</td>
</tr>
</thead>
</table>
</section>
</main>
<script src="js/calcula-imc.js"></script>
<script src="js/form.js"></script>
<script src="jquery-3.4.1.min.js"></script>
</body>
</html>
Below the javascript (I have these two buttons to work with scroll up and down):
var up = document.getElementById("#up");
var down = document.getElementById("#down");
I have these functions to use:
up.addEventListener("click", function (event){
});
down.addEventListener("click", function (event){
});
Edit your question and put what you have of code, so it is easier to answer you, only with the image can not help you much
– hugocsl
so help already?
– Matheus Berns
Yes now the community has to vote to reopen it
– hugocsl
@Matheusberns see if this code http://jsfiddle.net/s5mgX/1709/ help
– Guto Xavier