jQuery: How to toggle switches programmatically

Let’s say you have some HTML/CSS switches in place of a traditional checkbox. jQuery makes it easy to toggle switches on or off. For example: function toggle(){ $(‘.slider’).click(); } Which can be called in a button like so: <button type=”button” class=”btn btn-primary” onClick=”toggle();”>Toggle</button> For example:   Note: This same jQuery can be triggered without clicking … Continue reading jQuery: How to toggle switches programmatically

HTML & CSS: How to stack Font Awesome icons

In order to stack Font Awesome ions, someone wrote a custom CSS solution that features a class called “icons-stack”, which looks like: .icon-stack { position: relative; display: inline-block; width: 150px; height: 150px; line-height: 80px; vertical-align: middle; } .icon-stack-1x, .icon-stack-2x, .icon-stack-3x { position: absolute; left: 0; width: 100%; text-align: center; } .icon-stack-1x { line-height: inherit; } … Continue reading HTML & CSS: How to stack Font Awesome icons