Skip to content

Instantly share code, notes, and snippets.

View kazzkiq's full-sized avatar

Claudio Holanda Jr. kazzkiq

View GitHub Profile
@kazzkiq
kazzkiq / switcher.html
Last active October 21, 2015 21:28
Switcher Riot Component
<ac-switch>
<div class="ac-switch">
<input name="switcher" type="checkbox" id="{ opts.id }" onchange="{ makeSwitch }" />
<label for="{ opts.id }"></label>
<span name="labelOn">{ opts.labelon }</span>
<span name="labelOff">{ opts.labeloff }</span>
</div>
<style>
function resultsFromForm(el){
var results = {};
$('.question',el).each(function(){
var iv = $('input:checked', this)[0].value;
if(iv.split("|").length > 1){
var iarray = iv.split("|"), isize = iarray.length, i;
console.log(iarray);
for(i = 0; i < isize; i++){
if(results[iarray[i]] == undefined){
@kazzkiq
kazzkiq / scrollersScanner
Created March 11, 2014 18:45
Find which elements are exploding your window size (creating scrollbars)
function scanForScrollers(el) {
var i = [],
t, x, y, w, h,
ww = $(window).width(),
wh = $(window).height();
el.each(function (index) {
t = $(this);
x = t[0].offsetLeft;
y = t[0].offsetTop;
@kazzkiq
kazzkiq / centralizer.css
Created January 29, 2014 18:12
Final way to centralize liquid element vertical and horizontally (with CSS3)
/*
The world need to know about this.
Most part taken from: http://pt.stackoverflow.com/a/166/1754 (its in portuguese)
IE 9+ , Chrome , Firefox , Opera , iOS 3.2+ , Android 2.1+ , IE Mobile 10+
*/
.centralize-me{
position:absolute; /*fixed works too*/