This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3.time.format("%-I %p"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//return an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else | |
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) | |
if (i == key && obj[i] == val || i == key && val == '') { // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-width : 320px) | |
and (max-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen | |
and (min-width : 321px) { | |
/* Styles */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var width = 100, | |
height = 200, | |
rotation = 0; | |
node.addEventListener("gesturechange", function(event){ | |
var style = event.target.style; | |
// scale and rotation are relative values, | |
// so we wait to change our variables until the gesture ends | |
style.width = (width * event.scale) + "px"; | |
style.height = (height * event.scale) + "px"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node.addEventListener("touchmove", function(event){ | |
// Only deal with one finger | |
if(event.touches.length == 1){ | |
// Get the information for finger #1 | |
var touch = event.touches[0], | |
// Find the style object for the node the drag started from | |
style = touch.target.style; | |
// Position the element under the touch point | |
style.position = "absolute"; | |
style.left = touch.pageX + "px"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
box-decoration-break: slice | clone; | |
Info: http://css-infos.net/property/box-decoration-break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
length: {number}, /* # of class on this element */ | |
add: function() { [native code] }, | |
contains: function() { [native code] }, | |
item: function() { [native code] }, /* by index */ | |
remove: function() { [native code] }, | |
toggle: function() { [native code] } | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.giveMeEllipsis { | |
overflow: hidden; | |
text-overflow: ellipsis; | |
display: -webkit-box; | |
-webkit-line-clamp: 2; /* number of lines to show */ | |
-webkit-box-orient: vertical; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<title>Simplest jQuery Slideshow</title> | |
<style> | |
body { font-family:Arial, Helvetica, sans-serif; font-size:12px; } | |
.fadein { position:relative; height:332px; width:500px; } | |
.fadein img { position:absolute; left:0; top:0;} | |
.fadein.ready img { -webkit-transition: opacity 1s linear;} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Set these on animated elements for iPad and iPhone to possibly optimize*/ | |
#foo { | |
-webkit-transform: translate3d(x,y,z); /* hardware acceleration */ | |
-webkit-perspective: 0; /*prevent flickering */ | |
-webkit-backface-visibility: hidden; /*prevent backgrounds showing through */ | |
} |
NewerOlder