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
"Bootstrap Street Lights click to activate the light"
Bootstrap 3.3.0 Snippet by
cleonr8
3.3.0
jQuery
tree
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
5.0K
 
1 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.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="light row"> <div class="lights redlight col-md-1"></div> <div class="lights orangelight col-md-1"></div> <div class="lights greenlight col-md-1"></div> </div> </div>
/*! Light */ .light { background-color: whitesmoke; box-shadow: 0 0 5px rgba(0,0,0, .8); overflow: hidden; padding: 0 0 4px; width: 140px; } .light div { border-radius: 50px; display: block; height: 30px; margin: 4px auto 0; opacity: .1; width: 30px; padding-left: 30px; } /*! Light colours */ .redlight { background-color: red; } .orangelight { background-color: orange; } .greenlight { background-color: green; } /*! Active states */ .light div.active { opacity: 1; } .light .redlight.active { box-shadow: 0 0 10px red; background-color: red; } .light .orangelight.active { box-shadow: 0 0 10px orange; background-color: orange; } .light .greenlight.active { box-shadow: 0 0 10px green; background-color: green; }
$(document).ready(function () { $('.light div').on('click', function () { $(".lights").removeClass('active'); $(this).addClass("active"); }); });
Related:
See More
Template
Paper Kit 2 PRO Angular
55.2K
39
Light-weight spinner indicator (ASCII)
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76