Skip to content

Instantly share code, notes, and snippets.

@jiguang
jiguang / orientation.js
Created August 19, 2014 02:19
orientation change
/*
**设备旋转提示
*/
$(function(){
var bd = $(document.body);
window.addEventListener('onorientationchange' in window ? 'orientationchange' : 'resize', _orientationchange, false);
function _orientationchange() {
scrollTo(0, 1);
switch(window.orientation){
case 0: //横屏
@mixin centerer {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@mixin font($size){
font-size: #{$size}px;
line-height: #{$size}px;
height: #{$size}px;
}
@jiguang
jiguang / _function.scss
Created May 27, 2014 07:12
scroll touch
%scroll_touch{ -webkit-overflow-scrolling: touch; -webkit-user-select: none; -ms-user-select: none; user-select: none; }
%slash_fix{ backface-visibility:hidden; -webkit-backface-visibility:hidden;-ms-backface-visibility:hidden; -webkit-transform-style: preserve-3d; }
%two_line{ overflow : hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;}
%box{
display: box;
display: -ms-box;
display: -webkit-box;
display: flex;
display: -ms-flexbox;
display: -webkit-flex;
%border_box{ -webkit-box-sizing: border-box; box-sizing: border-box; }
@mixin elli{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.WX_tab, .WX_nav, .WX_me_item, .QQ_tab, .hd_me_item {
display: box;
display: -ms-box;
display: -webkit-box;
display: flex;
display: -ms-flexbox;
display: -webkit-flex;
}
.WX_tab a, .WX_nav a, .WX_me_item a, .QQ_tab a, .hd_me_item a {