Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

head.js: weird negative html margin?

Maybe some of you have already some experience with using head.js. I'm a first-time user and I'm having some problems: as soon as I try to load multiple javascript files my <html> tag get a style="margin-left: -32767px;" applied.

<script type="text/javascript">
   var path = "<?php bloginfo('template_directory'); ?>";

   head.js( path + "/js/jquery-1.5.min.js", path + "/js/css3-mediaqueries.js",
         path + "/js/jquery-cookie.js", path + "/js/scripts.js", function() { });
</script>

Any idea why that happens? When I get rid of that weird style attribute in my html with Firebug all javascript libraries work just fine. However when the page loads the content flickers and as soon as this negative margin gets applied absolutely nothing is visible on my page.

like image 322
matt Avatar asked Feb 22 '26 05:02

matt


1 Answers

The negative margin is coming from css3-mediaqueries.js

the code is:

var _57 = document.documentElement;
_57.style.marginLeft = "-32767px";
setTimeout(function () {
    _57.style.marginTop = "";
}, 20000);

I don't know what purpose this has but you could probably delete this without a problem, if you don't want to do that then I would apply a style on the html tag

style="margin-left:0 !important;"

or with JS:

document.getElementsByTagName("HTML")[0].style.margin = "0"
like image 56
timewaster51 Avatar answered Feb 23 '26 19:02

timewaster51



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!