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
// this works fine | |
render: function() { | |
var content = []; | |
if (this.state.showResults && this.props.results.length) { | |
content.push(<ResultList results={this.props.results} onResultSelectAction={this.onResultSelectAction} />); | |
} | |
return ( | |
<div className="searchbox-wrapper"> |
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
// quick and dirty check for webkit, which has a bug that it does not compute the | |
// proper scrollTop, when overflowX is set on the body. We can use this to decide | |
// when we have to disable fixed-attachment backgrounds, because they lead to a rendering | |
// issue in webkit. This test is just a naive implementation and probably could be improved | |
// but works fine for now. | |
var overflowScrollTopBuggy = function overflowScrollTopBuggy () { | |
if (testFixedBackgrounds.buggy) { | |
return testFixedBackgrounds.buggy; | |
} | |
var body = document.querySelector('body'); |
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 body = document.querySelector('body'); | |
body.scrollTop = 100; | |
console.log(body.scrollTop); // 0 :( |
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
window.addEventListener('scroll', function (e) { | |
// unfortunately this will never fire | |
console.log('we are scrolling!'); | |
}, false); | |
document.querySelector('body').addEventListener('scroll', function (e) { | |
// this one will fire though | |
console.log('yay!'); | |
}, false); |
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
html,body { | |
/* this fix background images with fixed positioning */ | |
overflow-x:hidden | |
} |
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
.my-fixed-item { | |
-webkit-backface-visibility: hidden; | |
-webkit-transform: translateZ(0); | |
} |
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
video { | |
min-width: 100%; | |
min-height: 100%; | |
position: fixed; | |
left: 0; | |
top: 0; | |
z-index: -1; | |
} |
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
.container { | |
background: #f00; | |
width:50px; | |
height: 50px; | |
} | |
.container:before { | |
content: " "; | |
display: block; | |
background:#fff; |
NewerOlder