Skip to content

Instantly share code, notes, and snippets.

View bcullen's full-sized avatar

Brendan Cullen bcullen

View GitHub Profile
@bcullen
bcullen / gist:5119448
Created March 8, 2013 20:06
Quick & dirty hack for an element absolutely positioned with CSS calc() in IE8
// For .element {right: -webkit-calc(50% - 510px); right: calc(50% - 510px);}
$(document).ready(function() {
calcHack();
$(window).resize(calcHack);
function calcHack() {
var windowWidth = $(window).width();
var offset = 510;
var position = (windowWidth /2) - offset;