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
//long version | |
function getAllEvents() { | |
return Object.getOwnPropertyNames(document) | |
.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(Object.getPrototypeOf(document)))) | |
.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(window))) | |
.filter(function(i){return !i.indexOf('on')&&(document[i]==null||document[i].call)}) | |
.filter(function(elem, pos, self){return self.indexOf(elem) == pos}) | |
} | |
//short, one line version (262 chars) |
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
/** | |
* Works everywere ( IE7+, FF, Chrome, Safari, Opera ) | |
* Example: http://jsbin.com/afAQAWA/2/ | |
*/ | |
.rotated-text { | |
display: inline-block; | |
overflow: hidden; | |
width: 1.5em; | |
} | |
.rotated-text__inner { |
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
querySelectorAll = function(index, i, result, magicValue){ | |
magicValue = 1000; | |
return function(rule){ | |
var head = document.getElementsByTagName('head')[0]; | |
var style = document.createElement('style'); | |
var css = rule + ' { position:absolute; color:red; top: '+ magicValue + 'px;}'; | |
style.setAttribute('type', 'text/css'); | |
if(style.styleSheet && !style.sheet) style.styleSheet.cssText=css; | |
else style.innerHTML = css; |
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
/* You can test this solution using this link | |
** http://jsbin.com/UwIwuTeG/9 | |
** | |
** test results can be found here | |
** http://www.browserstack.com/screenshots/4cf227612539dfee2f50495a5b5c9b838d7928d3 | |
** | |
** ':root' is a nice filter for modern browsers | |
** http://htmlbook.ru/css/root | |
** | |
** this solution is based on LEA VEROU css only switch |
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
/* you can test this control using this link | |
** http://jsbin.com/orePosUh/4 | |
** | |
** some test results | |
** http://www.browserstack.com/screenshots/194bf28709cddb6b361017a813e18d420f0a2c9c | |
*/ | |
.progress_common { | |
width:220px; | |
height:15px; | |
border-radius: 10px; |
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
/* you can test it here | |
** http://jsbin.com/oWepeVI/4 | |
** | |
** you can see some results here http://www.browserstack.com/screenshots/b82dc9a833f2aa3ec76a3737ba48d942a19cc5f2 | |
*/ | |
.article .textpart-left { | |
position: absolute; | |
width: 50%; | |
margin: 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
/* you can test this solution here | |
** http://jsbin.com/IfaTodEW/5 | |
*/ | |
.container { | |
display: table; | |
width: 100%; | |
} | |
.container .wraper { | |
display: table-cell; |
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 outer(t){ | |
for (var i = 0; i<3; i++){ | |
function test(){return gl()(); | |
var a = 1; | |
console.log(a + b); | |
} | |
console.log(test()); | |
} | |
} |
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
// weird Chrome, Y.browser bug with position been saved | |
// browser jumps to hash id and then jumps to last scrolled position | |
$(window).on('load', function(){ | |
setTimeout(function(){ | |
var initialUrlHash = getInitialUrlHash(); | |
if (initialUrlHash) { | |
document.body.scrollTop = $(initialUrlHash).offset().top; | |
} | |
},0); | |
}); |