Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Color Changer"
Bootstrap 3.0.0 Snippet by
AdnanKhan123
3.0.0
jQuery
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
2.2K
 
0 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="apDiv1"></div> <div class="apDiv12"></div> <div class="apDiv2"> <button class="red" id="btn-1"></button> <button class="blue" id="btn-2"></button> <button class="yellow" id="btn-3"></button> </div> </div> </div>
.apDiv1 { position:absolute; left:9px; top:110px; width:1300px; height:44px; background-color:#666666; z-index:1; } .apDiv12 { position:absolute; left:9px; top:160px; width:600px; height:44px; background-color:#666666; z-index:1; } .apDiv2 { position:absolute; left:9px; top:0px; width:45px; height:104px; background-color:#ccc; z-index:1; } .red { position:relative; float:right; margin-right:10px; margin-top:10px; width:21px; height:19px; background-color:red; z-index:4; } .blue { position:relative; float:right; margin-right:10px; margin-top:10px; width:21px; height:19px; background-color:blue; z-index:4; } .yellow { position:relative; float:right; margin-right:10px; margin-top:10px; width:21px; height:19px; background-color:yellow; z-index:4; }
$(document).ready(function() { $("#btn-1").click(function() { $(".apDiv1, .apDiv12").css({"background-color" :"red"}); }); $("#btn-2").click(function() { $(".apDiv1, .apDiv12").css({"background-color" :"blue"}); }); $("#btn-3").click(function() { $(".apDiv1, .apDiv12").css({"background-color" :"yellow"}); }); });
Related:
See More
Template
Paper Kit Pro
66.3K
63
Flat color progress bars
63.3K
74
Cool Alerts Alternate Color
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76