1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript in PAGE_CONTAINER

Discussion in 'XenForo Development Discussions' started by king8084, Jan 17, 2015.

  1. king8084

    king8084 Active Member

    unless my syntax is off, i'm unsure why my test script isn't working in page_container:

    in page_container:
    Code:
    
    <script>
    if ( $('body').css('-webkit-font-smoothing') === 'antialiased')
    {
               $('body').css({'margin-top', '-50px !important'});
    }
    </script>
    </head>
    
    where inspector shows:
    upload_2015-1-17_15-28-29.png

    again, this is just a test and isn't ultimately what i want to do with the script, but not sure why this isn't behaving as expected?
     
    Last edited: Jan 18, 2015
  2. king8084

    king8084 Active Member

    appropriate fix:

    Code:
    <script>
    $(document).ready(function(){
    if ( $("body").css("-webkit-font-smoothing") === "antialiased") {
    $("body").css("margin-top","-50px");
    }
    });
    </script>
    
     

Share This Page