Skip to content

Instantly share code, notes, and snippets.

View WebMaestroFr's full-sized avatar

Etienne Baudry WebMaestroFr

View GitHub Profile
@WebMaestroFr
WebMaestroFr / grid-to-tiles.js
Last active August 29, 2015 13:57
Arrange grid elements into tiles. Works great if most of your columns match in width, and if you keep your wider ones on top...
(function ($) {
'use strict';
$.fn.wmTiles = function () {
var container = $(this),
tiles = container.children(),
arrange = function () {
var places = [{
t: 0,
l: 0,
w: container.width()
@WebMaestroFr
WebMaestroFr / bootstrap-peekaboo-labels.js
Last active August 29, 2015 13:57
Hide labels behind inputs on Bootstrap's horizontal forms, until the user starts to fill them up and it's then sliding on. Preferably for inputs with placeholders.
(function ($) {
'use strict';
$.fn.bsPeekabooLabel = function () {
var input = $(this),
control = input.closest('[class*="col-"]'),
label = control.siblings('.control-label'),
show = false,
place = function (d) {
var m;
if ($(control).css('float') === 'left') {
@WebMaestroFr
WebMaestroFr / showdown-hideup.js
Last active April 25, 2016 10:35
jQuery Plugin to fade in and out with a vertical slide
(function ($) {
'use strict';
var getUnqueuedOpts = function (opts) {
return {
queue: false,
duration: opts.duration,
easing: opts.easing
};
};
$.fn.showDown = function (opts) {