View verticallyCentered.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
.verticallyCentered{ | |
position: absolute; | |
top: 50%; | |
left: 0; | |
-webkit-transform: translateY(-50%); | |
-moz-transform: translateY(-50%); | |
-o-transform: translateY(-50%); | |
-ms-transform: translateY(-50%); | |
transform: translateY(-50%); | |
} |
View justify-to-center.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
/* JUSTIFY TO CENTER */ | |
#subMenu ul{ | |
vertical-align: middle; /*Or anything else*/ | |
width: 100%; | |
max-width: 960px; /*Allow items to be distributed only in this maximum space, remove if you need all 100% */ | |
margin: 0 auto; /*Center*/ | |
text-align: justify; | |
} | |
#subMenu ul:after{ |
View transitions.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
/* TRANSITIONS */ | |
.transitionAll{ | |
-webkit-transition: all 0.5s ease; | |
-moz-transition: all 0.5s ease; | |
-o-transition: all 0.5s ease; | |
-ms-transition: all 0.5s ease; | |
transition: all 0.5s ease; | |
} |
View border-box.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
/* BORDER-BOX */ | |
.dontMessWithMyPadding{ | |
-ms-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
} |
View search-regex-for-sublime.js
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
//SEARCH REGEX for sublime Text | |
//Begins with AA and ends with BB: | |
(?=AA)(.*)(?<=BB) | |
//After AA and before BB: | |
(?<=AA)(.*)(?=BB) |
View setBoxHeight.js
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
/* Set boxes height to match the highest box on the same row */ | |
setBoxHeight: function(){ | |
var boxes = $j('.myBoxes', this.$scope); //Selector and scope | |
var boxesByRow = 3; //Nb of items on a row | |
//Create each row | |
for(var i = 0; i < boxes.length; i+=boxesByRow) { | |
var newRow = boxes.slice(i, i+boxesByRow); | |
setHeight(newRow); | |
} |
View setImgSize.js
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
setImgSize: function() { | |
// Get containers size Height and Width) | |
var containerH = $('.myContainer').height(); | |
var containerW = $('.myContainer').width(); | |
// Get images natural size and calculate ratio: | |
// if image is wider than the container, class "wide" sets height to 100% and width to auto | |
// otherwise, class "tall" sets width to 100% and height to auto | |
$('.image').each(function(){ | |
var thisImg = $(this); |
View tableTransposer.js
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
$("table").each(function() { | |
if ( !$(this).hasClass("reverted") ) { | |
var $this = $(this); | |
var newrows = []; | |
$this.find("tr").each(function(){ | |
var i = 0; | |
$(this).find("td, th").each(function(){ | |
i++; | |
if(newrows[i] === undefined) { | |
newrows[i] = $("<tr></tr>"); |
View resizeTimer.js
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
//https://css-tricks.com/snippets/jquery/done-resizing-event/ | |
var resizeTimer; | |
$(window).on('resize', function(e) { | |
clearTimeout(resizeTimer); | |
resizeTimer = setTimeout(function() { | |
// Run code here, resizing has "stopped" | |
View isRetinaOrHighDensity.js
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 isHighDensity(){ | |
return ((window.matchMedia && (window.matchMedia('only screen and (min-resolution: 124dpi), only screen and (min-resolution: 1.3dppx), only screen and (min-resolution: 48.8dpcm)').matches || window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)').matches)) || (window.devicePixelRatio && window.devicePixelRatio > 1.3)); | |
} | |
function isRetina(){ | |
return ((window.matchMedia && (window.matchMedia('only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx), only screen and (min-resolution: 75.6dpcm)').matches || window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min--moz-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2)').matches)) || (window.devicePixelRatio && window.devicePixelRatio >= |
OlderNewer