Created
March 24, 2016 19:49
-
-
Save SIRHAMY/d15aafeb1a788d2f071f to your computer and use it in GitHub Desktop.
Dynamically change Twitter Bootstrap Progress Bar color with JQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="progressbar" | |
class="progress-bar progress-bar-custom | |
progress-bar-striped-custom" | |
role="progressbar" | |
aria-valuenow="70" aria-valuemin="0" | |
aria-valuemax="100" style="width: 70%;"> | |
Progress Bar Text | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var progressBarColor; | |
var someValueToCheck = 5; | |
if(someValueToCheck >= 10) progressBarColor = "#A52A2A"; | |
else if(someValueToCheck >=5) progressBarColor = "#00FFFF"; | |
else progressBarColor = "#00008B"; | |
$("#progressbar").css('background-color', progressBarColor); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment