One of many ways in which to achieve fancy checkboxes. Can do the same for radio buttons by changing the input type as needed and updating styles.
A Pen by Tiffany Brown on CodePen.
@mixin placeholder{ | |
&:focus::-webkit-input-placeholder{ | |
color: transparent; | |
} | |
&:focus::-moz-placeholder { | |
color: transparent; | |
} | |
&:focus:-ms-input-placeholder { | |
color: transparent; |
/* | |
input = number or numeric string. | |
length = pad with zeroes until it hits this length. | |
*/ | |
function zeroPadLeft(input, length){ | |
var zero = '0', pad = '', len, padded, inp, extract; | |
/* Convert to string */ | |
inp = input+''; |
var median = function(array){ | |
var med, a, len; | |
len = array.length; | |
/* Sort by numeric value */ | |
a = array.sort(function(a,b){return a - b}); | |
med = Math.floor(len / 2); | |
var mean = function(array){ | |
var len, sum; | |
sum = array.reduce( function(a,b){ | |
return a + b; | |
}); | |
len = array.length; | |
return sum / len; | |
} | |
mean([2,4]); // 3 |
function formattime(timeinseconds){ | |
var zeroes = '0', hours, minutes, seconds, time; | |
/* | |
Create a new date object and pass our time in seconds as the seconds parameter | |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date | |
*/ | |
time = new Date(0, 0, 0, 0, 0, timeinseconds, 0); | |
hours = time.getHours(); |
One of many ways in which to achieve fancy checkboxes. Can do the same for radio buttons by changing the input type as needed and updating styles.
A Pen by Tiffany Brown on CodePen.
// Removes the # from hexRGB colors for use in SVG data URIs | |
@function removeHash($hexColor){ | |
$hexColor: $hexColor + ''; // Convert to a string | |
$colorNum: str-slice($hexColor,2); | |
@return $colorNum; | |
} | |
// Sample usage | |
@mixin check($fillColor) { | |
$noHashColor: removeHash($fillColor); |
<?php | |
function factorial($num){ | |
$rng = range(1,$num); | |
return array_product($rng); // array_product function requires PHP5.1.0+ | |
} | |
print factorial(10); // 3628800 |
<?php | |
/* | |
Add this code to functions.php. Then add Woothemes' FlexSlider to your templates | |
as you otherwise would. | |
Rewrite 29 September 2014 to use WordPress filters instead of overwriting the | |
shortcode handler. | |
*/ |