index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import 'css/bootstrap.less';
  2. import 'bootstrap/dist/js/bootstrap.js';
  3. import 'css/newMenu/public.css';
  4. import 'css/newMenu/header.css'
  5. import 'css/newMenu/index.css';
  6. import 'css/inded.css';
  7. import 'js/banner.js';
  8. import 'js/public.js';
  9. (function(){
  10. "use strict";
  11. init();
  12. function init(){
  13. banner();
  14. };
  15. //轮播
  16. navTop();
  17. function navTop() {
  18. $(window).scroll(function(){
  19. var scrolltop=$(document).scrollTop();
  20. if(scrolltop>0){
  21. $('.topNav').addClass('navFix')
  22. }else{
  23. $('.topNav').removeClass('navFix');
  24. }
  25. });
  26. }
  27. function banner(){
  28. $('#myCarousel').carousel({
  29. interval: 4000
  30. })
  31. };
  32. //搜索框上面栏目的选择
  33. $(".jumpType li").click(function(){
  34. $(this).addClass("active");
  35. $(this).siblings().removeClass("active");
  36. })
  37. //搜索功能
  38. $(".searchBtn").click(function(){
  39. //var seachon=$(".jumpType li.active").index();
  40. var key=$('.demandSearch').val();
  41. sessionStorage.setItem("name",key);
  42. window.open(globalConfig.context + `/portal/search.html`);
  43. // switch(seachon){
  44. // case 0:window.open(globalConfig.context + `/portal/technologyTrading/achievementList.html?name=${key}`);break;
  45. // case 1:window.open(globalConfig.context + `/portal/technologyTrading/demandList.html?name=${key}`);break;
  46. // case 2:window.open(globalConfig.context + `/portal/service/patentList?name=${key}`);break;
  47. // case 3:window.open(globalConfig.context + `/portal/thinkTank/policyList?name=${key}`);break;
  48. // case 4:window.open(globalConfig.context + `/portal/service/serviceList?name=${key}`);break;
  49. // default :break;
  50. // }
  51. })
  52. }())