Skip to content

Instantly share code, notes, and snippets.

View KruegerDesigns's full-sized avatar

Adam Krueger KruegerDesigns

View GitHub Profile
@KruegerDesigns
KruegerDesigns / ie.version.html.class.js
Created January 4, 2012 22:50
Add Internet Explorer version to your html tag class.
// Added this js to give the HTML tag IE detection (e.g. ie7).
if($.browser.msie)
{
$('html').addClass('ie' + ($.browser.version).slice(0,1));
}
@KruegerDesigns
KruegerDesigns / add.remove.selector.class.js
Created January 21, 2012 00:43
CSS Selector Classes Via jQuery
// creates classes for these selector behaviors
$(":first-child").addClass('first-child');
$(":last-child").addClass('last-child');
// keep this in mind if you need to remove one
// of the previous classes from an element
$('.Email').removeClass('first-child')
@KruegerDesigns
KruegerDesigns / ios.html.class.js
Created February 1, 2012 18:17
Add iOS class to html tag for iphone, ipod, and ipad.
// adds ios class to html tag
jQuery(document).ready(function($){
var deviceAgent = navigator.userAgent.toLowerCase();
var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
if (agentID) {
$('html').addClass('ios');
}
});
@KruegerDesigns
KruegerDesigns / wrap.in.tag.js
Created February 1, 2012 22:50
Wrap contents of a tag in a span, or other tag.
// Used to style ol li items when applied by a WYSIWYG editor.
$("#content ol li").each(function(){
$(this).contents().wrap("<span>");
});
@KruegerDesigns
KruegerDesigns / android.ios.html.class.js
Created April 24, 2012 16:45
Android, iOS detection, then adds a class to the HTML tag.
// adds mobile browser class to html tag
var ua = navigator.userAgent.toLowerCase();
function removeSpaces(ua) {
return ua.split(' ').join('');
}
ua = removeSpaces(ua);
var iOS = ua.match(/(iphone|ipod|ipad)/);
if(iOS) {
$('html').addClass('ios');
}
@KruegerDesigns
KruegerDesigns / blur-png-images.css
Created May 15, 2012 15:06
This CSS will cause harsh black edges on transitioning PNGs to fade or blur to white in IE8 and IE7.
.slideshow img {
background: transparent;
-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); /* IE6 & 7 */
zoom: 1;
}
@KruegerDesigns
KruegerDesigns / gist:2763436
Created May 21, 2012 17:31
Simple dynamic to static RewriteRule for .htaccess files.
# Will rewrite a dynamic URL to a static URL
RewriteRule /thing.*/stuff.html /new/location [R=301,L]
@KruegerDesigns
KruegerDesigns / android-content-resize-fix.css
Created May 21, 2012 21:22
Android: fix resizing of content area, add a transparent gif
.android #content >* {
background-image: url('http://d1xt3jhdg1opoa.cloudfront.net/transizr.gif');
}
@KruegerDesigns
KruegerDesigns / ios-fix-font-zoom.css
Created May 21, 2012 21:25
iPad/iPhone: fix font zooming
body { -webkit-text-size-adjust:100%; }
@KruegerDesigns
KruegerDesigns / gist:3943098
Created October 24, 2012 01:10
Beautiful type, fixes for jQuery transitions and more! IE8
/* This is magic, makes the slide look beautiful in ie8 */
.ie8 slideshow-wrapper slide {
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=99)";
}