Skip to content

Instantly share code, notes, and snippets.

@ghooghe
ghooghe / media-queries-syntax.css
Created June 11, 2013 09:21
media queries syntax
/* px */
@media only screen and (max-width: 1024px) {}
@media only screen and (max-width: 768px) {}
@media only screen and (max-width: 720px) {}
@media only screen and (max-width: 320px) {}
/* dpi */
@media all and (min-resolution: 150dpi) {}
@media all and (min-resolution: 200dpi) {}
@media all and (min-resolution: 300dpi) {}
@ghooghe
ghooghe / console-debug-for-all.js
Created June 11, 2013 09:33
console.debug declaration to avoid javascript error problems
// Console declaration if not defined
if (typeof console === 'undefined' || typeof console.debug === 'undefined') {
console = {};
console.debug = function() {};
}
@ghooghe
ghooghe / selection-colors.css
Created June 11, 2013 09:34
Selection colors
/* Selection colours (easy to forget) */
::selection { background: #404d23; color: #ffffff; }
::-moz-selection { background: #404d23; color: #ffffff; }
img::selection { background: transparent; }
img::-moz-selection { background: transparent; }
body { -webkit-tap-highlight-color: #404d23; color: #ffffff; }
@ghooghe
ghooghe / best-rendering.html
Created June 11, 2013 09:37
html meta tags for better rendering on IE, mobile and others
<!-- Always force latest IE rendering engine (even in intranet) -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- Mobile Viewport Fix
j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag
device-width : Occupy full width of the screen in its current orientation
initial-scale = 1.0 retains dimensions instead of zooming out if page height > device height
maximum-scale = 1.0 retains dimensions instead of zooming in if page width < device width
Adding "maximum-scale=1" fixes the Mobile Safari auto-zoom bug: http://filamentgroup.com/examples/iosScaleBug/
@ghooghe
ghooghe / reset-compressed.css
Created June 11, 2013 09:38
Eric Meyer's reset.css compressed version
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
@ghooghe
ghooghe / ie-html-class.html
Created June 11, 2013 13:34
Conditional class for ie detection needs
<!--[if lt IE 7]><html class="ie ie6 lt10 lt9 lt8 lt7"><![endif]-->
<!--[if IE 7]><html class="ie ie7 lt10 lt9 lt8"><![endif]-->
<!--[if IE 8]><html class="ie ie8 lt10 lt9"><![endif]-->
<!--[if IE 9]><html class="ie ie9 lt10"><![endif]-->
<!--[if gt IE 9]><html class="ie ie10"><![endif]-->
<!--[if !IE]><!--><html><!--<![endif]-->
@ghooghe
ghooghe / transfer-click-to-tap.js
Created June 11, 2013 15:17
Transfer click event to tap, only if not on a touch device
// Transfer click event to tap, only if not on a touch device
if (!('ontouchend' in window)) {
$(document).delegate('body', 'click', function(e) {
$(e.target).trigger('tap');
});
}
@ghooghe
ghooghe / loader-with-text.js
Created June 11, 2013 15:19
Loader with text/font caracters
// Prepare loader
var loaderSymbols = ['&#59275;', '&#59276;', '&#59277;'],
loaderEl = $(blockingOverlaySelector + ' span'),
loaderIndex = 0,
loader = function() {
loaderEl.html(loaderSymbols[loaderIndex]);
loaderIndex = loaderIndex < loaderSymbols.length - 1 ? loaderIndex + 1 : 0;
};
setInterval(loader, 350);
@ghooghe
ghooghe / obox.js
Created June 11, 2013 15:20
obox - custom lightbox made for PE/emeeting needs
//obox
var obox = {
resize: function(container) {
var frame = $(window);
// Resize
container.css('width', frame.width() + 'px');
container.css('height', frame.height() + 'px');
// Center
@ghooghe
ghooghe / obox.css
Created June 11, 2013 15:21
obox.css
.obox {
top: 0;
left: 0;
position: absolute;
z-index: 100;
overflow-x: hidden;
overflow-y: auto;
/*max-width: 930px;*/
}