I'm attempting to adjust some elements on a page dynamically when it gets resized (or opened on smaller displays). There is a piece of code that looks roughly like this:
$('some_id').setStyle({'margin-left':'200px'});
And it works as intended in Chrome but is failing in Firefox with no JavaScript warning or errors. And to be clear I have inspected the element in Firefox. It's straight up just not getting the style set. If I manually add in this rule with the inspector it works as intended.
More code has been requested:
function reset_ad_size() {
topAlign($('leftColumn'), $('adContentLeftFloat'));
leftSide = leftAlign($('mainBodyFrame'), $('adContentLeftFloat'));
leftSide -= 190;
if(leftSide < 0) {
$('site_wrap_neo').setStyle({'margin-left':'200px'});
leftSide = 5;
}
$('adContentLeftFloat').setStyle({left:leftSide+'px'});
}
document.observe("dom:loaded", function() {
reset_ad_size();
window.onresize = function() {
reset_ad_size();
}
});