简体   繁体   中英

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.

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM