0
Good evening, people I’m with the following problem, in the layout I’m mounting has several lines in different places during the course of the page, the customer wants these lines to appear and grow coming from different directions, initially I made one of these lines using the Html5’s"Progress", but I can only do this when it is to increase the width, when the line is vertical I have problems, I tried to use Transform Rotate but it was not good because even using the Rotate it still occupies the side size on the screen, anyway I wanted other ways to make this line increase, which is malleable so I can increase the width and height without harming the layout, I’m doing so for now, so ta with the Rotate:
<progress id="barra1" class='custom' max='100' value='0' data-value=''></progress>
<script>
var $progress = document.querySelector('#barra1'), // Pegando o elemento
MAXIMUM = $progress.max; // Pegando o valor máximo:
100
/* Aumentando o valor a cada 1 segundo... */
var interval = setInterval(function(){
$progress.value++;
if($progress.value >= MAXIMUM)
clearInterval(interval);
}, 100);
</script>
.custom {
background-color: #dc853d;
width: 800px;
height: 1px;
transform: rotate(270deg);
}
I really liked the answer, but there’s something not working, I mean when I put in the retreat inspect and put the width works perfectly, but when loading the normal page the line already appears with 100%
– André
Try to put
width="0%"
instead of just0
, but as the saying of the programmer says... on my machine it worked, hehe. Ahh, a super tip instead of typingF5
to refresh the page, pressctrl+F5
, many dependent file changes likecss
orjs
, not always update only onF5
normal.– Luiz
understand rs, Because I liked the way using Transition but really not going, look here at js fidle https://jsfiddle.net/nmLdtsmy/1/
– André
already appearing 100%, only if I take and put the width in the inspect then it works know
– André
Dude, I realized that in my code that I tested, it wasn’t exactly the same, I’m gonna update my answer to you, sorry.
– Luiz
Now yes very good rs friend loved the result of your example rs any way to do to track the scroll bar? because in this way despite being much simpler than the way I was doing but if the line has below on the page the effect may not be noticed, but it has helped a lot seen
– André
It’s good that I helped, there are some guys in the community who only fail, besides not helping. Well.. to accompany the scrolling page, as far as I know, only using css
position:fixed
ai, if for example you are going to put a line on the right side of the page, add aright: 5px
, if at the top, atop: 0px
and so on.– Luiz