This is for teaching purpose.
Forked from linmic's Pen CSS Panorama Viewer Skeleton.
*{margin:0;padding:0;} | |
.text{ | |
display: inline-block; | |
font-size:16px; | |
vertical-align: middle;/* 保证文字垂直居中 */ | |
} | |
.box-1{ | |
height:200px; |
.container{ | |
width:95%; | |
height:200px; | |
background: #f90; | |
margin: 10px auto 0; | |
position: relative; | |
} | |
.box-1{ | |
width:30%; |
[ | |
{ | |
"class": "label_control", | |
"color": [255, 255, 255], | |
"shadow_color": [24, 24, 24], | |
"shadow_offset": [0, -1] | |
}, | |
{ | |
"class": "button_control", | |
"content_margin": [6, 5, 6, 6], |
Convert image from clipboard to base64 encoded data with JavaScript | |
http://stackoverflow.com/questions/11194209/convert-image-from-clipboard-to-base64-encoded-data-with-javascript | |
<div contenteditable></div> | |
$('div[contenteditable]').bind('paste', function(e) { | |
alert(123); | |
var data = e.originalEvent.clipboardData.items[0].getAsFile(); | |
var elem = this; | |
var fr = new FileReader; | |
webkit & firefox
Forked from Dima Karpov's Pen CSS 3D Panorama.
@charset "utf-8"; | |
//注意animate keyframe 不能嵌套 | |
@include animate-flipOutY; | |
>h1{ | |
width: 200px; | |
height: 200px; | |
background-color: green; | |
@include ceaser-transition(all , 600ms, $easeInOutBack); | |
//@include transition(all 600ms ceaser($easeInOutBack)); |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
onclick="loadPanel(this,{'name':'er','age':'12'})" | |
json = {'name':'er','age':'12'} //输出直接就是jsond对像 | |
onclick='loadPanel(this,"{\"name\":\"er\"}")' | |
json = "{\"name\":\"er\"}") //输出是json字符串 | |
function loadPanel(obj,json){ | |
console.log(json); | |
var json = eval('(' + json + ')'); | |
console.log(json); |
Perfect horizontal AND vertical centering in CSS, at any width or height!
Works with percentage based width/height, min-/max- width, images, position: fixed and even variable content heights.
Updated Aug 13: Added a comparison table, an explanation, more documentation, and a Modernizr test for variable height
Updated Aug 16: Minor corrections and clarifications