1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- import 'bootstrap/dist/js/bootstrap.js';
- import 'css/newMenu/public.css';
- import 'css/newMenu/header.css'
- import 'css/newMenu/index.css';
- import 'css/inded.css';
- import 'js/public.js';
- (function(){
- "use strict";
- init();
- function init(){
- banner();
- };
- navTop();
- function navTop() {
- $(window).scroll(function(){
- var scrolltop=$(document).scrollTop();
- $('.topNav')[scrolltop>0?'addClass':'removeClass']('navFix');
- // videoAuto();
- });
- }
- //轮播
- function banner(){
- $('#myCarousel').carousel({
- interval: 4000
- })
- };
- //搜索框上面栏目的选择
- $(".jumpType li").click(function(){
- $(this).addClass("active");
- $(this).siblings().removeClass("active");
- })
- //搜索功能
- $(".searchImg").click(function(){
- var key=$('.demandSearch').val();
- sessionStorage.setItem("name",key);
- window.open(globalConfig.context + `/portal/search.html`);
- })
- function task(){
- if($(".brands>div>img:nth-child(1)").hasClass("active")){
- $(".brands>div>img:nth-child(3)").css("opacity","0");
- $(".brands>div>img").removeClass("bni").removeClass("ani").removeClass("active");
- $(".brands>div>img:nth-child(2)").addClass("ani").addClass("active");
- }else if($(".brands>div>img:nth-child(2)").hasClass("active")){
- $(".brands>div>img:nth-child(1)").css("opacity","0");
- $(".brands>div>img").removeClass("bni").removeClass("ani").removeClass("active");
- $(".brands>div>img:nth-child(3)").addClass("ani").addClass("active");
- }else if($(".brands>div>img:nth-child(3)").hasClass("active")){
- $(".brands>div>img:nth-child(2)").css("opacity","0");
- $(".brands>div>img").removeClass("bni").removeClass("ani").removeClass("active");
- $(".brands>div>img:nth-child(1)").addClass("ani").addClass("active");
- }
-
- }
- setInterval(task,4000);
- //初始悬浮窗口处理
- initModel();
- function initModel(){
- if(!sessionStorage['initVal']){ //为true时显示了一次
- $('.initModel').addClass('active');
- }
- sessionStorage['initVal']=true;
- $('.initModel .glyphicon-remove').click(function(){
- $(this).parents('.initModel').removeClass('active');
- })
- if($('.initModel').hasClass('active')){
- setTimeout(()=>{
- $('.initModel .glyphicon-remove').trigger('click');
- },10000)
- }
- };
- //视频自动播放处理
- let status=true;
- var myVideo=document.getElementById("video1");
- function videoAuto(){
- let videoH = $('.wield_cont')[0],
- clentH = videoH.getBoundingClientRect();
- if(clentH.top < (document.documentElement.clientHeight+200)){
- if(status){ //只自动播放一次
- myVideo.play();
- status=false;
- }
- }
- }
- //防止下载
- $('#video1').hover(function(){
- document.oncontextmenu=function(e){
- return false
- }
- },function(){
- document.oncontextmenu=function(e){
- }
- })
- }())
|