mains.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* ========================================================================= */
  2. /* Preloader
  3. /* ========================================================================= */
  4. jQuery(window).load(function(){
  5. $("#preloader").fadeOut("slow");
  6. });
  7. $(document).ready(function(){
  8. // 分类过滤排序插件
  9. var $projectWrapper = $('.project-wrapper');
  10. $projectWrapper.isotope({
  11. filter: '*',
  12. animationOptions: {
  13. duration: 750,
  14. easing: 'linear',
  15. queue: false
  16. }
  17. });
  18. $('.portfolio-filter a').click(function(){
  19. $('.portfolio-filter .active').removeClass('active');
  20. $(this).addClass('active');
  21. var selector = $(this).attr('data-filter');
  22. $projectWrapper.isotope({
  23. filter: selector,
  24. animationOptions: {
  25. duration: 750,
  26. easing: 'linear',
  27. queue: false
  28. }
  29. });
  30. return false;
  31. });
  32. // 单页首页翻页特效
  33. // $('#nav').singlePageNav({
  34. // offset: $('#nav').outerHeight(),
  35. // filter: ':not(.external)',
  36. // speed: 2000,//动画时间
  37. // currentClass: 'current',
  38. // easing: 'easeInOutExpo',
  39. // updateHash: true,
  40. // beforeStart: function() {
  41. // console.log('开始滚动');
  42. // },
  43. // onComplete: function() {
  44. // console.log('滚动结束');
  45. // }
  46. // });
  47. // 顶部导航高度变化
  48. $(window).scroll(function () {
  49. if ($(window).scrollTop() > 10) {
  50. $(".navbar-brand a").css("color","#fff");
  51. $("#navigation").addClass("animated-header");
  52. $(".el-menu--popup-bottom-start").css("margin-top","15px")
  53. } else {
  54. $(".navbar-brand a").css("color","inherit");
  55. $("#navigation").removeClass("animated-header");
  56. $(".el-menu--popup-bottom-start").css("margin-top","5px")
  57. }
  58. });
  59. /* ========================================================================= */
  60. /* Fix Slider Height
  61. /* ========================================================================= */
  62. // 首页图片随屏幕高度变化
  63. var slideHeight = $(window).height();
  64. let W = $(window).width();
  65. // $('.sl-slider, .sl-content-wrapper').css('height',slideHeight);
  66. $(window).resize(function(){
  67. // $('.sl-slider, .sl-content-wrapper').css('height',slideHeight);
  68. $("bg-img").css('width',W)
  69. });
  70. });