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 top = obj.getBoundingClientRect().top //元素顶端到可见区域顶端的距离 | |
var se = document.documentElement.clientHeight //浏览器可见区域高度。 | |
if(top <= se ) { | |
//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
.disable-hover { | |
pointer-events: none; | |
} |
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
// A simple mixin to give dimensions to a box. | |
@mixin box($width, $height: $width) { | |
width: $width; | |
height: $height; | |
} | |
// clearfix | |
@mixin clearfix { | |
&:after { | |
content: ""; |
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
/// Convert one unit into another | |
/// @author Hugo Giraudel | |
/// @param {Number} $value - Initial value | |
/// @param {String} $unit - Desired unit | |
/// @return {Number} | |
/// @throw Error if `$unit` does not exist or if units are incompatible. | |
@function convert-unit($value, $unit) { | |
$units: ( | |
'px': 0px, | |
'cm': 0cm, |
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
//----------------------------------------------------// | |
// compass css sprite for x or 2x or 3x background image | |
//----------------------------------------------------// | |
$sprites-spacing: 5px; | |
@import "icons/*.png"; // got a variable named $icons-sprites | |
// @import "icons-2x/*.png"; // got a variable named $icons-2x-sprites | |
// @import "icons-3x/*.png"; // got a variable named $icons-3x-sprites | |
@mixin get-sprite( $map, $sprite, $x: 1, $adjustX: 0, $adjustY: 0, $positionAdjustY: 0, $repeat: no-repeat ) { |