We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6408
    • 58 Posts
    Hi

    I have a problem with a jquery script that loads in my template files, in that *sometimes* it fails to load. i know the script is working fine - it seems to be the time that Modx Revo takes to render the page (which seems to be dreadfully slow in Revo anyway).

    The jquery script is equalheights - essentially it makes any elements named with the same class have an equalheight so on a three column layout, Im using it to make all the columns have an equal height.

    Anyone have any thoughts?

    i cant show a demo of the problem as the site is in development.

    However, the ’HEAD’ section of my template is called in a chunk and contains the call to the jquery and an equalheights plugin (which is occasionally failing to render.)




      • 26903
      • 1,336 Posts
      Could you show us the call itself, or the chunk?
        Use MODx, or the cat gets it!
        • 6408
        • 58 Posts
        Of course, no problem, and many thanks for the reply:

        here is the call to the chunk: [[$head]]

        and this is the chunk:

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
         <title>[[++site_name]] | [[*pagetitle]]</title>
          <meta http-equiv="Content-Type" content="text/html; charset=[[++modx_charset]]" />
        <meta name="keywords" content="[[*metaKeywords]]" />
        <meta name="description" content="[[*metaDescription]]" />
          <base href="[[++site_url]]"></base>
          
        
        <script src="assets/templates/arclight/script/jquery.js" type="text/javascript"></script>
        
        <script src="assets/templates/arclight/script/equalHeights.js" type="text/javascript"></script>
        <script src="assets/templates/arclight/script/menu.js" type="text/javascript"></script>
        
        
        <script type="text/javascript">
           $(document).ready(function() {
        	$(".col").equalHeights();
        });
            </script>
        <link href="assets/templates/arclight/stylesheets/styles.css" rel="stylesheet" type="text/css" />
        </head>


        I should add that the script is supposed to execute when the page has been rendered - and the javascript calculates the height of the columns depending on the tallest column (obviously). It seems that for whatever reason its mis-firing as the page loads - when it goes wrong, a scrollbar appears on (usually) the middle column. So it seems to be calculating the length of the middle column against the left and right columns (the left and right columns are normally a fairly consistent height) and miscalculating it. If the page is refreshed, the scrollbar dissappears and it works fine.

        All the columns are called in their own chunks also.

        No errors reported in the javascript console in either circumstance.


        Here’s a link to the eualHeights plugin: http://www.cssnewbie.com/equalheights-jquery-plugin/
          • 5340
          • 1,624 Posts
          can you also add

          $(window).load(function () {
              $(".col").equalHeights();
          });


          and let me know if the problem persists
            • 6408
            • 58 Posts
            Quote from: cipa at Aug 09, 2011, 03:33 PM

            can you also add

            $(window).load(function () {
                $(".col").equalHeights();
            });


            and let me know if the problem persists

            thanks for the reply - sadly it didnt work sad
              • 6408
              • 58 Posts
              I might as well post the URL to see if it helps:

              http://www.networkdigital.co.uk/dev

              user and password is: locked for both.

              if you use the ’blue’ solutions navigation on the left and just go through the options you will see what I mean. occasionally if the scrollbar appears (usually on the middle column) - if you do a refresh it will dissappear.

              Dan
                • 5340
                • 1,624 Posts
                You have 2 files missing on the home page

                "NetworkError: 404 Not Found - http://www.networkdigital.co.uk/dev/indicator.gif"
                and
                "NetworkError: 404 Not Found - http://www.networkdigital.co.uk/dev/assets/templates/arclight/stylesheets/slider-layout.css"

                Fix those and we’ll see what else needs to be done
                  • 6408
                  • 58 Posts
                  Hi those 404 errors should now be fixed - thanks for pointing them out smiley - however I should add neither should have any direct affect on the issue
                    • 5340
                    • 1,624 Posts
                      • 5340
                      • 1,624 Posts
                      Also on the home page the fullCol is missing the col class. I think this is your problem