Skip to content

Instantly share code, notes, and snippets.

// http://www.codeatlarge.com/percentage-minus-pixels/
var $wrap = $(".wrap");
var $navitem = $(".wrap nav .navitem");
$(window).resize(function(){
var totalWidth = $wrap.width();
var calcWidth = (totalWidth - 200) / 3;
$navitem.width(calcWidth);
@oleksapro
oleksapro / detect ie
Last active December 28, 2015 11:35
html, js
JS
1. http://codepen.io/gapcode/pen/vEJNZN
HTML + JS
2. http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript
<!doctype html>
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8"> <![endif]-->
@oleksapro
oleksapro / get css
Created September 2, 2015 08:34
js, css
http://jsfiddle.net/hAw53/
1. http://stackoverflow.com/questions/23724419/background-attachmentfixed-internet-explorer-11-odd-up-down-jiggle
only for body
body {
background-attachment: fixed;
}
2. не дергается если убрать z-index: -1
http://davidwalsh.name/document-readystate
@oleksapro
oleksapro / font-face
Created September 8, 2015 11:27
ie, font
// Чтобы отображался в ie должен заканчиваться форматом woff
@font-face {
font-family: "Muli Light";
src: url("../fonts/muli/muli-light.ttf") format("truetype");
src: url("../fonts/muli/muli-light.woff") format("woff");
}
addEvent(scene, 'selectstart', function(event) {
event.preventDefault();
return false;
});
addEvent(scene, 'mousedown', function(event) {
event.preventDefault();
return false;
});
@oleksapro
oleksapro / disable font boosting
Created September 11, 2015 12:43
font, mobile, css
http://habrahabr.ru/post/214559/
html * {max-height:1000000px;}
@oleksapro
oleksapro / debug jiggle img, hover
Last active September 17, 2015 09:29
css, img, hover
http://stackoverflow.com/questions/12502234/how-to-prevent-webkit-text-rendering-change-during-css-transition/12820319#12820319
transform: translateZ(0px);
or
http://stackoverflow.com/questions/12980153/image-moves-on-hover-chrome-opacity-issue
backface-visibility: hidden;
@oleksapro
oleksapro / slider
Created September 17, 2015 20:50
slider
<div class="tab">
<div class="box visible">
<h4>People talking about <a href="#">#APP-PLUS</a></h4>
<p>Join our #APP-PLUS adventure. Meet up in London this Saturday! Spread the word and join us for fun.</p>
</div>
<div class="box">
<h4>Users loving <a href="#">#APP-PLUS</a></h4>
<p>Joining this weekend's #APP-PLUS fun! @emmy_lemmy bring your dogs, we can make it a fun walk!</p>
</div>
<div class="box">