mains.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. } else {
  53. $(".navbar-brand a").css("color","inherit");
  54. $("#navigation").removeClass("animated-header");
  55. }
  56. });
  57. /* ========================================================================= */
  58. /* Fix Slider Height
  59. /* ========================================================================= */
  60. // 首页图片随屏幕高度变化
  61. var slideHeight = $(window).height();
  62. let W = $(window).width();
  63. // $('.sl-slider, .sl-content-wrapper').css('height',slideHeight);
  64. $(window).resize(function(){
  65. // $('.sl-slider, .sl-content-wrapper').css('height',slideHeight);
  66. $("bg-img").css('width',W)
  67. });
  68. });