jq.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. angular.module('app')
  3. .directive('layout', [function() {
  4. return {
  5. restrict: 'A',
  6. link: function(scope, element, attrs) {
  7. var ww = $(window).width();
  8. var wh = $(window).height();
  9. var mainbox = $('.ui_mainbox');
  10. if (wh - 76 < 425) {
  11. mainbox.height(425);
  12. } else {
  13. mainbox.height(wh - 76);
  14. }
  15. if (ww > 1600) {
  16. mainbox.width(1600);
  17. $('.ui_button').width(1580);
  18. } else {
  19. mainbox.width(1200);
  20. $('.ui_button').width(1180);
  21. }
  22. //$('.cb,.rb').inputbox();
  23. $(window).resize(function() {
  24. ww = $(window).width();
  25. wh = $(window).height();
  26. if (wh - 76 < 425) {
  27. mainbox.height(425);
  28. } else {
  29. mainbox.height(wh - 76);
  30. }
  31. if (ww > 1600) {
  32. mainbox.width(1600);
  33. } else {
  34. mainbox.width(1200);
  35. }
  36. });
  37. }
  38. };
  39. }])