View durationtransitionprop.js
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
function getMaxDurationTransitionProperty(el) { | |
// small helper to extract the values | |
function extract(str) { | |
return str | |
.replace(/[A-Z]/gi, "") | |
.split(", ") | |
.map(parseFloat); | |
}; | |
// get the current style | |
var style = getComputedStyle(el); |
View blurry-example.html
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
<img class="blurry" src="super-tinyimage-small.jpg" /> | |
<div class="blurry" style="background-image:url(super-tinyimage-small.jpg);"></div> |
View ios-viewport-scaling-bug-fix-original.js
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
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
var metas = document.getElementsByTagName('meta'); | |
var i; | |
if (navigator.userAgent.match(/iPhone/i)) { | |
for (i=0; i<metas.length; i++) { | |
if (metas[i].name == "viewport") { | |
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
} | |
} |