$(function(){
$('#selectChoice').change(function(){
$('option:selected',this).each(function(){
var id = $('#selectChoice option:selected').attr('id');
$('#' + id + 'Item').css("color", "#f00").css("font-weight", "bold");
$('#' + id + 'Item').css("color", "#f00").css("font-weight", "bold");
$('#' + id + 'Item').css("color", "#f00").css("font-weight", "bold");
$('#' + id + 'Item').css("color", "#f00").css("font-weight", "bold"); //end html(function
}); //end each(function
}); //end change(function
$('#plus25').on('click', function(evt) {
var id= $('#selectChoice option:selected').attr('id');
$('#' + id + 'Item').html(function(i, value) {
var newWidth = parseInt(value*1+25);
$('#' + id + 'Item').css('width', newWidth + '%');
if (value === 75 || value < 75){return newWidth;}
else { safePreventDefault(evt);}
});
});
$('#plus10').on('click', function(e) {
var id= $('#selectChoice option:selected').attr('id');
$('#' + id + 'Item').html(function(i, value) {
var newWidth = parseInt(value*1+10);
$('#' + id + 'Item').css('width', newWidth + '%');
if (value === 90 || value < 90){return newWidth;}
else { safePreventDefault(e);}
});
});
$('#minus25').on('click', function(e) {
var id= $('#selectChoice option:selected').attr('id');
$('#' + id + 'Item').html(function(i, value) {
var newWidth = parseInt(value*1-25);
$('#' + id + 'Item').css('width', newWidth + '%');
if (value === 25 || value > 25){return newWidth;}
else { safePreventDefault(e);}
});
});
$('#minus10').on('click', function(e) {
var id= $('#selectChoice option:selected').attr('id');
$('#' + id + 'Item').html(function(i, value) {
var newWidth = parseInt(value*1-10);
$('#' + id + 'Item').css('width', newWidth + '%');
if (value === 10 || value > 10){return newWidth;}
else { safePreventDefault(e);}
});
});
safePreventDefault=function(evt){
//fix for IE Bug
evt = evt || window.event;
if (evt) {
evt.returnValue = false;
}
if ((evt)&&(evt.preventDefault))
{ evt.preventDefault(); }
};
});
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px; padding-top:50px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px; padding:20px;
background-color: #666;
}
#progress1, #progress2, #progress3
{ background-color:#fff;
margin:10px 20px 10px 20px;
height: 20px !important;
width: 96.5%;}
.item {background-color:#269abc !important;
text-align: center;
margin:0; float:left;
width:0}
.well {background-color:#666;}
select {margin:10px 0 0 10px;}
.col-md-1 {min-width: 90px;}
.hide-for-med {display: block;}
/* Responsive Styles */
@media(max-width:1200px) {.hide-for-med {display: none;}}
@media(max-width:991px) {
.customer-img,.img-related {margin-bottom: 30px; }
#progress1, #progress2, #progress3 {width:95%;}
select {margin-left: 0}.hide-for-med {display: block;height:20px;}
.col-md-1 {width:20%; display: inline-block}
}
@media(max-width:767px) {
.img-portfolio { margin-bottom: 15px; }
#progress1, #progress2, #progress3 {width:94%;}
}
@media(max-width:480px) {
#progress1, #progress2, #progress3 {width:90% !important;}
.hide-for-med {width:10px !important; float:left; }
.col-md-1 {min-width:70px; margin:20px 0 0 5px; padding: 0; }
}
<link href="http://georgehowell.biz/test/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">jQuery+Bootstrap</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="index.html">About</a>
</li>
<li>
<a href="index.html">Services</a>
</li>
<li>
<a href="index.html">Contact</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<br /><hr />
<!-- Main Section -->
<div class="well">
<div class="row">
<div id="selectChoice-items">
<div class="col-md-12" id="progress1"><div id="output1Item" class="item">0</div></div>
<div class="col-md-12" id="progress2"><div id="output2Item" class="item">0</div></div>
<div class="col-md-12" id="progress3"><div id="output3Item" class="item">0</div></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<select class="btn btn-lg btn-default btn-block" name="selectChoice" id="selectChoice" data-native-menu="false" data-mini="true" >
<option>select a row</option>
<option value="1" id="output1">progress 1</option>
<option value="2" id="output2">progress 2</option>
<option value="3" id="output3">progress 3</option>
</select>
</div>
<div class="col-md-4 hide-for-med"></div>
<div class="col-md-1">
<a class="btn btn-lg btn-default btn-block" href="#" id="minus25">-25</a>
</div>
<div class="col-md-1">
<a class="btn btn-lg btn-default btn-block" href="#" id="minus10">-10</a>
</div>
<div class="col-md-1">
<a class="btn btn-lg btn-default btn-block" href="#" id="plus10">+10</a>
</div>
<div class="col-md-1">
<a class="btn btn-lg btn-default btn-block" href="#" id="plus25">+25</a>
</div>
</div>
</div>
<hr />
</div>
<!-- /.container -->
<!-- Footer -->
<footer class="footer">
<div class="row">
<div class="col-lg-12">
<p></p>
</div>
</div>
</footer>