//插入头部和尾部 $(document).ready(function(){ //$("#header").load("/zgsmile/Html/header/header.html"); //$("#bottom").load("/zgsmile/Html/footer/footer.html"); //$(".sideRight").load("/zgsmile/Html/Side/sideRight.html"); //$(".md-modal").load('/zgsmile/Html/Dialog/Porder.html'); $(".md-modal").load('/Dialog/Porder.html'); document.getElementsByTagName("body")[0].style.display = "block"; }) $(function(){ //回到顶部 $(document).on("click",".backTop", function () { $('body,html').stop().animate({ 'scrollTop': 0, 'duration': 100, 'easing': 'ease-in' }) }) $(window).scroll(function () { if ($(this).scrollTop() > 250) { $(".backTop").fadeIn(); } else { $(".backTop").fadeOut(); } }) //企业下单 $(document).on("click",".BusyOrder",function(){ $(".md-modal").addClass("md-show") }) $(document).on("click",".md-close",function(){ $(".md-modal").removeClass("md-show") }) }) function hideloading() { setTimeout(function () { $("#loading").remove(); },10) } function getFillContainer(url, obj, data) { $(obj).html("等待中..."); $.ajax({ type: 'GET', url: url, data: data ? data : null, beforeSend: function () { //目标对象上显示加载提示 //$(obj).showLoading(); }, success: function (response) { hideloading(); $(obj).html(response); }, error: function () { $(obj).html("加载失败!请稍后重试!"); }, complete: function () { //关闭加载提示 //$(obj).closeLoading(); } }); } //轮播图 function focusBanner(ObjA,next,Prev,Bubble){ var $focusBanner=$(ObjA), $bannerList=$focusBanner.find("li"), $nextBnt=$(next), $prevBnt=$(Prev), $focusBubble=$(Bubble), bannerLength=$bannerList.length, _index=0, _timer=""; var _height=$bannerList.height(); for(var i=0; i"); } $focusBubble.find("li").eq(0).addClass("current"); var bubbleLength=$focusBubble.find("li").length; $focusBubble.css({ "width":bubbleLength*22, "marginLeft":-bubbleLength*11 });//初始化 $focusBubble.on("click","li",function(){ $(this).addClass("current").siblings().removeClass("current"); _index=$(this).index(); changeImg(_index); });//点击轮换 $nextBnt.on("click",function(){ _index++ if(_index>bannerLength-1){ _index=0; } changeImg(_index); });//下一张 $prevBnt.on("click",function(){ _index-- if(_index<0){ _index=bannerLength-1; } changeImg(_index); });//上一张 function changeImg(_index){ $bannerList.eq(_index).fadeIn(250); $bannerList.eq(_index).siblings().fadeOut(200); $focusBubble.find("li").removeClass("current"); $focusBubble.find("li").eq(_index).addClass("current"); clearInterval(_timer); _timer=setInterval(function(){$nextBnt.click()},5000) }//切换主函数 _timer=setInterval(function(){$nextBnt.click()},5000) }