var isIE = function(){ if ((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i)=="7.") || (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8.")) { return true; }else{ return false; } } function isMobile(){ var w_width = $(window).width(); if (w_width <= 1024) { return true; } else if (w_width > 1024) { return false; }; } $(window).load(function(){ if (isIE()){ $('.loader-bg').fadeOut(300,function(){ $('.scrolltop').stop().animate({top:0,opacity:1},500) }); }else if(!isMobile()){ $('.loader-bg').fadeOut(300,function(){ $('.scrolltop').stop().animate({top:0,opacity:1},500) }) }else{ $('.loadingBg').fadeOut(300,function(){ $('.scrolltop').stop().animate({top:0,opacity:1},500) }); } }); $(function(){ console.log($(window).height()) //$('.serch-bg').height($(window).height() - 78); $("header .right a.search-btn").click(function(e){ e.preventDefault(); $("header nav li").addClass("hide"); $("header .right a").addClass("hide"); $("header .search-box").show(); $("header .search-box .close").show().stop().animate({ top : 26, opacity : 1 }, 500, "linear", function(){ Enter($("header .search-box input").eq(0), "left", 0, 2, 500, 300) setTimeout(function(){ $("header .search-box .list").show(); Enter($("header .search-box .list").children().eq(0), "left", 0, $("header .search-box .list").children().length, 200, 100) }, 500) }) $(".serch-bg").stop().fadeIn(1000, "linear") }) $("header .search-box .close, .serch-bg").click(function(e){ $("header nav li, header .right a").removeClass("hide"); $("header .right .close").hide().css({ top : 15, opacity : 0 }) $(".serch-bg, header .search-box").hide(); $("header .search-box .list").hide(); $("header .search-box input").css({ left: 5 + '%', opacity : 0 }) $("header .search-box .list").children().css({ left: 5 + '%', opacity : 0 }) }) $('footer .top li:last').css('width','118'); var len = $('.loadpic').length; if (len == 0) { $('.loader-bg').fadeOut(); return false; }else{ $('.loadpic').each(function(){ var src = $(this).attr('data-img') console.log(src); _PreLoadImg([src],function(){ $('.loader-bg').fadeOut(); $('.scrolltop').stop().animate({top:0,opacity:1},300) }) }) } // $(window).scroll(function(){ // var clen = $('.cont-box').length; // console.log(clen); // if (clen == 0) { // var cont = 0; // }else{ // var cont = $('.cont-box').offset().top - $('.inline-nav').height(); // } // if ($(window).scrollTop() > cont) { // $('.inline-nav').addClass('pof'); // $('.none').show(); // }else{ // $('.inline-nav').removeClass('pof'); // $('.none').hide(); // } // }) $('.inline-banner .btn').on('click',function(){ var cont = $('.cont-box').offset().top - ($('.inline-nav').height()) + 10; $('html,body').stop().animate({scrollTop:cont},800,'linear'); }) $('.inline-nav li.pan').hover(function(){ $(this).find('.con').stop().slideDown(500) $('.inline-bg').stop().slideDown(300) },function(){ $(this).find('.con').stop().slideUp(100) $('.inline-bg').stop().slideUp(300) }) });