_layout_align_columns.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <script>
  2. $(document).ready(function () {
  3. resizeLayoutBlocks();
  4. $(window).on('resize', function() {
  5. resizeLayoutBlocks();
  6. })
  7. });
  8. function resizeLayoutBlocks()
  9. {
  10. if ($(window).width() <= 720)
  11. return;
  12. var iTimeout = 500;
  13. var oLevelCells = function(iCellSmall, iCellLarge) {
  14. $('#bx-layout-cell-' + iCellSmall + ' .bx-db-container').css('min-height', $('#bx-layout-cell-' + iCellLarge + ' .bx-db-container').height());
  15. }
  16. if (1 == $('#bx-layout-cell-3 > div').length && 1 == $('#bx-layout-cell-2 > div').length) {
  17. var oCell2 = $('#bx-layout-cell-2 .bx-db-container');
  18. var oCell3 = $('#bx-layout-cell-3 .bx-db-container');
  19. if (oCell2.height() > oCell3.height()) {
  20. if(oCell2.find('form .bx-form-input-files-uploaders').length > 0)
  21. setTimeout(function() {
  22. oLevelCells(3, 2);
  23. }, iTimeout);
  24. else
  25. oLevelCells(3, 2);
  26. }
  27. else {
  28. if(oCell3.find('form .bx-form-input-files-uploaders').length > 0)
  29. setTimeout(function() {
  30. oLevelCells(2, 3);
  31. }, iTimeout);
  32. else
  33. oLevelCells(2, 3);
  34. }
  35. }
  36. }
  37. </script>