Here's the script:
---
function contentpadding() {
var content = document.getElementById("content");
var contentw = parseInt(window.getComputedStyle(content, null).width);
var container = document.getElementById("container");
var containerw = parseInt(window.getComputedStyle(container, null).width);
//alert(contentw);
var contentpadding = (containerw - contentw) / 2;
if (containerw > 1040) {
document.getElementById("content").style.paddingLeft = contentpadding + 'px';
document.getElementById("content").style.paddingRight = contentpadding + 'px';
} else {
document.getElementById("content").style.width = (contentw - 72) + 'px';
}
}
---
I worked out to get the values in jquery:
$("#content").css({
width: function(index, value) {
alert(parseInt(value));
}
});
Problem is, I suck at jquery.
T_T