I have a simple bootstrap Progress bar and i want to give it an infinite blinking effect. So i wrote the required codes and it show the blinking effect well but if i change the direction of the progress bar with float
a problem show itself to me and blinking will be stopped!
Live demo in SO:
.parrent{
border-radius:10px;
-webkit-transform: translateZ(0);
width:100px;
margin:0 auto;
}
.child{
width: 80% !important;
transition: all 2s ease;
opacity: .3;
}
.empty{
-webkit-animation-name: empty-anim;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: cubic-bezier(.5, 0, 1, 1);
-webkit-animation-duration: 1.7s;
}
@-webkit-keyframes empty-anim {
0% { opacity: 1; }
50% { opacity: .3; }
100% { opacity: 1; }
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
A. Without blink problem:
<div class="parrent progress progress-striped dropdown-toggle">
<div class="child empty progress-bar progress-bar-danger pull-right" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<hr>
B. With blink Problem:
<div class="parrent progress progress-striped dropdown-toggle">
<div class="child empty progress-bar progress-bar-danger pull-left" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Note: The different between 2 progress bar is just in using
pull-left
in (B
) instead ofpull-right
in (A
).
My question is why and what is your suggestion to solve this problem?
Edit:
My Browser: Google Chrome Version 56.0.2924.87