function websize(){ var winh = $(window).height(); var winw = $(window).width(); var wrapw = $("#video").width(); var wraph = $("#video").height(); if(winw >= 750){ $("#videobox").css({height:wrapw*0.5625+50}); } else { $("#videobox").css({height:winw*0.5625+50}); } } (function($) { "use strict"; /** * 鼠标划过就展开子菜单,免得需要点击才能展开 */ var windowwidth = $(window).width(); if(windowwidth >= 750){ $(document).ready(function(){ $(document).off('click.bs.dropdown.data-api'); }); $(document).ready(function(){ dropdownopen();//调用 }); } function dropdownopen() { var suseragent = navigator.useragent.tolowercase(); var bisipad = suseragent.match(/ipad/i) == "ipad"; var bisiphoneos = suseragent.match(/iphone os/i) == "iphone os"; var bismidp = suseragent.match(/midp/i) == "midp"; var bisuc7 = suseragent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; var bisuc = suseragent.match(/ucweb/i) == "ucweb"; var bisandroid = suseragent.match(/android/i) == "android"; var bisce = suseragent.match(/windows ce/i) == "windows ce"; var biswm = suseragent.match(/windows mobile/i) == "windows mobile"; if(windowwidth >= 750){ if (!(bisipad || bisiphoneos || bismidp || bisuc7 || bisuc || bisandroid || bisce || biswm)) { var $dropdownli = $('li.dropdown'); $dropdownli.mouseover(function() { $(this).find('.dropdown-menu').stop(true,false).slidedown(300); $(this).addclass('open'); }).mouseout(function() { $(this).find('.dropdown-menu').stop(true,false).slideup(300); $(this).removeclass('open'); }); } } if(windowwidth < 750){ if (!(bisipad || bisiphoneos || bismidp || bisuc7 || bisuc || bisandroid || bisce || biswm)) { // alert("当前是电脑打开"); $(document).ready(function () { $(document).off('click.bs.dropdown.data-api'); }); } } } /* mixitup ========================================================================== */ //$('#portfolio').mixitup(); var owl = $("#inproductlist-scroller"); owl.owlcarousel({ navigation: true, pagination: false, slidespeed: 1000, stoponhover: true, autoplay: true, items:5, itemstablet:3, margin:90, stagepadding:90, smartspeed:450, itemsdesktop : [1199,5], itemsdesktopsmall : [980,4], itemstablet: [768,3], itemstablet: [767,3], itemstabletsmall: [480,2], itemsmobile : [479,2], }); $('#inproductlist-scroller').find('.owl-prev').html(''); $('#inproductlist-scroller').find('.owl-next').html(''); var owl = $("#inaboutico-scroller"); owl.owlcarousel({ navigation: false, pagination: true, slidespeed: 1000, stoponhover: true, autoplay: true, items:5, itemstablet:3, margin:90, stagepadding:90, smartspeed:450, itemsdesktop : [1199,5], itemsdesktopsmall : [980,4], itemstablet: [768,3], itemstablet: [767,3], itemstabletsmall: [480,2], itemsmobile : [479,2], }); var owl = $("#inpic-scroller"); owl.owlcarousel({ navigation: true, pagination: false, slidespeed: 1000, stoponhover: true, autoplay: true, items:8, itemstablet:3, margin:90, stagepadding:90, smartspeed:450, itemsdesktop : [1199,8], itemsdesktopsmall : [980,6], itemstablet: [768,4], itemstablet: [767,4], itemstabletsmall: [480,2], itemsmobile : [479,2], }); $('#inpic-scroller').find('.owl-prev').html(''); $('#inpic-scroller').find('.owl-next').html(''); var owl = $("#incaselist-scroller"); owl.owlcarousel({ navigation: false, pagination: true, slidespeed: 1000, stoponhover: true, autoplay: true, items:2, itemstablet:3, margin:0, stagepadding:0, smartspeed:450, itemsdesktop : [1199,5], itemsdesktopsmall : [980,5], itemstablet: [768,2], itemstablet: [767,2], itemstabletsmall: [480,2], itemsmobile : [479,2], }); var owl = $("#product-scroller"); owl.owlcarousel({ navigation: true, pagination: false, slidespeed: 1000, stoponhover: true, autoplay: false, items:3, itemstablet:3, margin:90, stagepadding:90, smartspeed:450, itemsdesktop : [1199,3], itemsdesktopsmall : [980,3], itemstablet: [768,2], itemstablet: [767,2], itemstabletsmall: [480,1], itemsmobile : [479,1], }); $('#product-scroller').find('.owl-prev').html(''); $('#product-scroller').find('.owl-next').html(''); var owl = $("#productpiclist-scroller"); owl.owlcarousel({ navigation: false, pagination: true, slidespeed: 1000, stoponhover: true, autoplay: true, items:1, itemstablet:3, margin:90, stagepadding:90, smartspeed:450, itemsdesktop : [1199,1], itemsdesktopsmall : [980,1], itemstablet: [768,1], itemstablet: [767,1], itemstabletsmall: [480,1], itemsmobile : [479,1], }); var owl = $("#innewslist-scroller"); owl.owlcarousel({ navigation: false, pagination: true, slidespeed: 1000, stoponhover: true, autoplay: true, items:1, itemstablet:3, margin:90, stagepadding:90, smartspeed:450, itemsdesktop : [1199,1], itemsdesktopsmall : [980,1], itemstablet: [768,1], itemstablet: [767,1], itemstabletsmall: [480,1], itemsmobile : [479,1], }); /* testimonials carousel ========================================================*/ // var owl = $("#testimonials"); // owl.owlcarousel({ // navigation: false, // pagination: true, // slidespeed: 1000, // stoponhover: true, // autoplay: true, // items: 2, // itemsdesktop : [1199,2], // itemsdesktopsmall : [980,2], // itemstablet: [768,1], // itemstablet: [767,1], // itemstabletsmall: [480,1], // itemsmobile : [479,1], // }); //$('.testimonials').find('.owl-prev').html(''); //$('.testimonials').find('.owl-next').html(''); /* clients sponsor ========================================================================== */ $("#leibiea").click(function(){ $("#leibie").fadetoggle(600); }); $("#searcha").click(function(){ $("#searchbox").fadetoggle(600); }); $('#mymodal').on('shown.bs.modal', function (e) { // 关键代码,如没将modal设置为 block,则$modala_dialog.height() 为零 $(this).css('display', 'block'); var modalheight=$(window).height() / 2 - $('#mymodal .modal-dialog').height() / 2; $(this).find('.modal-dialog').css({ 'margin-top': modalheight }); }); /* back top link ========================================================================== */ $(window).bind("scroll",function(){ //var _wtop = _winscroll = windowpos = $(window).scrolltop(); var _wtop = $(this).scrolltop(); if(_wtop>100&&window.innerwidth>1024){ $('.right_bar').fadein(); }else{ $('.right_bar').fadeout(); } }); $('body').on('click', '.gotop', function() { $('html,body').stop(1).animate({ scrolltop: '0' }, 300); return false }); $('.right_bar li').eq(0).hover(function() { $(this).stop().animate({ left: -160 }, 300); }, function() { $(this).stop().animate({ left: 0 }, 300); }); $('.right_bar li').eq(1).hover(function() { $(this).stop().animate({ left: -160 }, 300); }, function() { $(this).stop().animate({ left: 0 }, 300); }); $('.right_bar li').eq(2).hover(function() { $(this).stop().find('.rtbar_shwx').show(); }, function() { $(this).stop().find('.rtbar_shwx').hide(); }); /* one page navigation & wow js ========================================================================== */ //initiat wow js new wow().init(); // // one page navigation $(window).on('load', function() { $('body').scrollspy({ target: '.navbar-collapse', offset: 195 }); // $(window).on('scroll', function() { // if ($(window).scrolltop() > 200) { // $('.headernav').addclass('fixed-top menu-bg'); // } else { // $('.headernav').removeclass('fixed-top menu-bg'); // } // }); }); /* nivo lightbox ========================================================*/ $('.lightbox').nivolightbox({ effect: 'fadescale', keyboardnav: true, directionnav:true, }); $('.video-popup').nivolightbox({ effect: 'fadescale', keyboardnav: true, }); /* page loader ========================================================================== */ // $(window).on('load',function() { // "use strict"; // $('#loader').fadeout(); // }); }(jquery));