You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

  1. $(function () {
  2. $('#side-menu').metisMenu();
  3. });
  4. /*=================================*/
  5. /* Intro Height */
  6. /*=================================*/
  7. function introHeight() {
  8. var wh = $(window).height();
  9. $('#home').css({ height: wh });
  10. }
  11. introHeight();
  12. $(window).on('resize', function () {
  13. //Update slider height on resize
  14. introHeight();
  15. });
  16. //Loads the correct sidebar on window load,
  17. //collapses the sidebar on window resize.
  18. // Sets the min-height of #page-wrapper to window size
  19. $(function () {
  20. $(window).bind("load resize", function () {
  21. topOffset = 50;
  22. width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
  23. if (width < 768) {
  24. $('div.navbar-collapse').addClass('collapse');
  25. topOffset = 100; // 2-row-menu
  26. } else {
  27. $('div.navbar-collapse').removeClass('collapse');
  28. }
  29. height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
  30. height = height - topOffset;
  31. if (height < 1) height = 1;
  32. if (height > topOffset) {
  33. $("#page-wrapper").css("min-height", (height) + "px");
  34. }
  35. });
  36. var url = window.location;
  37. var element = $('ul.nav a').filter(function () {
  38. return this.href == url || url.href.indexOf(this.href) == 0;
  39. }).addClass('active').parent().parent().addClass('in').parent();
  40. if (element.is('li')) {
  41. element.addClass('active');
  42. }
  43. });