$(document).ready(function(){ var ww=$('body').width(); if(ww<1025){ $('.wrap_').css('width','1200px'); } }); function more(id,fid){ var more=document.getElementById("more"+id); if(more){ more.href="do/list.php?fid="+fid; } } function init_c(){ document.getElementById('change').innerHTML=''; $('#change').hide(); } function weixinQR() { $('.weixin-qr').toggle(); } /* slightbox 废弃*/ function slightbox(obj,oclose,opacity,ctime){ var _this = this; _this.d = jQuery(obj); var mkdiv _this.cenvelop = function(){ if(opacity){ mkdiv = document.createElement("div"); jQuery(mkdiv).attr("id","win_pop_mask").css({position:"absolute",zIndex:"9998",left:"0",top:"0",background:"#000000"}); if(jQuery.browser.msie && jQuery.browser.version == "6.0"){ jQuery(mkdiv).html("") } jQuery("body").append(jQuery(mkdiv)); jQuery(mkdiv).css("opacity",opacity); } _this._resize(); } _this._resize = function(){ jQuery(mkdiv).css("height",Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight) + "px"); jQuery(mkdiv).css("width",document.documentElement.scrollWidth + "px"); var _x = Math.round((document.documentElement.clientWidth-this.d.width())/2); var _y = Math.round((document.documentElement.clientHeight-this.d.height())/2); _this.d.css({display:"block","position":"absolute","zIndex":"9999","left":_x+"px","top":_y+document.documentElement.scrollTop+"px"}); } _this.closed = function(){ jQuery(mkdiv).remove(); _this.d.hide(); return false; } var sctop = 0; jQuery(window).resize(function(){ if(_this.d.css("display") == "none") return; _this._resize(); }); var top = (document.documentElement.clientHeight-this.d.height())/2; jQuery(window).scroll(function(){ jQuery(mkdiv).css("height",Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight) + "px"); jQuery(obj).css("top",document.documentElement.scrollTop - sctop + top + "px"); sctop = document.documentElement.scrollTop; top = parseInt(jQuery(obj).css("top")); }); if(ctime){ setTimeout(_this.closed, ctime) } if(oclose){ jQuery(oclose).click(function(){_this.closed()}); } _this.cenvelop(); } /* ==轮播{对象|对象属性}== 对象属性{宽度|高度|文字大小|自动切换时间} */ function dk_slideplayer(object,config){ this.obj = object; this.config = config ? config : {width:"300px",height:"200px",fontsize:"12px",right:"10px",bottom:"10px",time:"5000"}; this.pause = false; var _this = this; if(!this.config.right){ this.config.right = "0px" } if(!this.config.bottom){ this.config.bottom = "3px" } if(this.config.fontsize == "12px" || !this.config.fontsize){ this.size = "12px"; this.height = "21px"; this.right = "6px"; this.bottom = "10px"; }else if(this.config.fontsize == "14px"){ this.size = "14px"; this.height = "23px"; this.right = "6px"; this.bottom = "15px"; } this.count = jQuery(this.obj + " li").size(); this.n =0; this.j =0; var t; this.factory = function(){ jQuery(this.obj).css({position:"relative",zIndex:"0",margin:"0",padding:"0",width:this.config.width,height:this.config.height,overflow:"hidden"}) jQuery(this.obj).prepend("
"); jQuery(this.obj + " li").css({width:"100%",height:"100%",overflow:"hidden"}).each(function(i){jQuery(_this.obj + " div").append(""+(i+1)+"")}); jQuery(this.obj + " img").css({border:"none",width:"100%",height:"100%"}) this.resetclass(this.obj + " div a",0); jQuery(this.obj + " p").each(function(i){ jQuery(this).parent().append(jQuery(this).clone(true)); jQuery(this).html(""); jQuery(this).css({position:"absolute",margin:"0",padding:"0",zIndex:"1",bottom:"0",left:"0",height:_this.height,width:"100%",background:"#000",opacity:"0.4",overflow:"hidden"}) jQuery(this).next().css({position:"absolute",margin:"0",padding:"0",zIndex:"2",bottom:"0",left:"0",height:_this.height,lineHeight:_this.height,textIndent:"5px",width:"100%",textDecoration:"none",fontSize:_this.size,color:"#FFFFFF",background:"none",zIndex:"1",opacity:"1",overflow:"hidden"}) if(i!= 0){jQuery(this).hide().next().hide()} }); this.slide(); this.addhover(); t = setInterval(this.autoplay,this.config.time); } this.slide = function(){ jQuery(this.obj + " div a").mouseover(function(){ _this.j = jQuery(this).text() - 1; _this.n = _this.j; if (_this.j >= _this.count){return;} jQuery(_this.obj + " li").hide(); jQuery(_this.obj + " p").hide(); jQuery(_this.obj + " li").eq(_this.j).fadeIn("slow"); jQuery(_this.obj + " li").eq(_this.j).find("p").show(); _this.resetclass(_this.obj + " div a",_this.j); }); } this.addhover = function(){ jQuery(this.obj).hover(function(){clearInterval(t);}, function(){t = setInterval(_this.autoplay,_this.config.time)}); } this.autoplay = function(){ _this.n = _this.n >= (_this.count - 1) ? 0 : ++_this.n; jQuery(_this.obj + " div a").eq(_this.n).trigger('mouseover'); } this.resetclass =function(obj,i){ jQuery(obj).css({float:"left",marginRight:"3px",width:"15px",height:"14px",lineHeight:"15px",textAlign:"center",fontWeight:"800",fontSize:"12px",color:"#000",background:"#FFFFFF",cursor:"pointer"}); jQuery(obj).eq(i).css({color:"#FFFFFF",background:"#FF7D01",textDecoration:"none"}); } this.factory(); } /* dk_lightbox {原slightbox}*/ (function(jQuery) { jQuery.dk_lightbox = function(object, options) { options = jQuery.extend({},options); var $jqobj = jQuery(object); var ie6 = (jQuery.browser.msie && jQuery.browser.version < 7); var $body = jQuery(document.body); var $window = jQuery(window); var $document = jQuery(document); if(ie6){ jQuery('select').css('visibility','hidden'); } if(options.opacity){ $ojbfade = jQuery("
").appendTo($body); } var ie6scroll = function(){ $jqobj.css({top:$window.scrollTop()+($window.height() - $jqobj.height())/2}); }; var positionLightBox = function(){ $jqobj.css({ position: (ie6) ? "absolute" : "fixed", top: (ie6) ? ($window.height() - $jqobj.height())/2+$window.scrollTop() : ($window.height() - $jqobj.height())/2, left: "50%", zIndex:"328", marginLeft: (($jqobj.outerWidth()/2)*-1) }); if(options.opacity){ $ojbfade.css({ position: "absolute", zIndex: 327, height: $document.height(), width: "100%", background: (options.background) ? options.background : "#000000", opacity: options.opacity, top: 0, left: 0, right: 0, bottom: 0 }); } }; var removePrompt = function(){ if(options.opacity){$ojbfade.hide();} $jqobj.hide(); if(ie6) {$body.unbind('scroll',ie6scroll);} $window.unbind('resize',positionLightBox); $jqobj.fadeOut('fast',function(){ jQuery('select').css('visibility','visible'); }); }; positionLightBox(); if(ie6) { $window.scroll(ie6scroll); } $window.resize(positionLightBox); if(options.closed){ $jqobj.find(options.closed).click(function(){removePrompt()}); } if(options.closedtime){ setTimeout(removePrompt,options.closedtime); } if(options.closedobj){ jQuery(options.closedobj).click(function(){removePrompt()}); } $jqobj.show(); }; })(jQuery); //simplescroll (function($){ $.fn.dk_simplescroll = function(options){ var opt = $.extend({},$.fn.dk_simplescroll.defaults,options); var $this = $(this); var scrollPause = false //是否暂停自动播放 var scrollWrapId = "scrollWrap_"+$this.attr('id');//包裹对象id var $scrollWrap;//包裹对象 var ChildSize = $this.children().size(); //获得子节点数量 var singleSize = opt.type == "x" ? $this.children().outerWidth() : $this.children().outerHeight(); //获得单个子节点尺寸 var overPlus = opt.type == "x" ? $this.width() - ChildSize* singleSize : $this.height() - ChildSize* singleSize; if(overPlus >= 0) {return false} //内容不够多时候自动退出 if(opt.auto){ opt.cycle = true; opt.action = "single"; } //初始化 var init = function(){ $this.css({position:"relative",zIndex:0}); if(opt.cycle){ //循环播放时将类容复制3份 opt.action = "single"; $this.html("
"+$this.html() + $this.html() + $this.html()+"
"); }else{ $this.html("
"+$this.html()+"
"); } $scrollWrap = $this.find("#"+scrollWrapId); if(opt.type == "x"){ $scrollWrap.width(singleSize*$scrollWrap.children().size()).css({left:0,top:0}); if(opt.cycle){ $scrollWrap.css("left",singleSize*ChildSize*(-1)); } }else{ $scrollWrap.height(singleSize*$scrollWrap.children().size()).css({top:0,left:0}); if(opt.cycle){ $scrollWrap.css("top",singleSize*ChildSize*(-1)); } } //绑定事件 if(opt.nextId){ $("#" + opt.nextId).click(function(){ if(opt.auto) {clearInterval(timeout);} if(opt.action == "single"){ doanimate(-1); }else if(opt.action == "group"){ if(opt.type == "x"){ doanimate(0-$this.width()/singleSize); }else{ doanimate(0-$this.height()/singleSize); } } return false; }); }; if(opt.prevId){ $("#" + opt.prevId).click(function(){ if(opt.auto) {clearInterval(timeout);} if(opt.action == "single"){ doanimate(1); }else if(opt.action == "group"){ if(opt.type == "x"){ doanimate($this.width()/singleSize); }else{ doanimate($this.height()/singleSize); } } return false; }); } if(opt.auto){ $this.hover(function(){ clearInterval(timeout); timeout = "mmover"; }, function(){ timeout = window.setInterval(function(){ doanimate(-1); },opt.autotime) } ) } } //移动事件 var doanimate = function(n){ if(scrollPause){return false;} scrollPause = true; var tmpPosVal = opt.type == "x" ? parseInt($scrollWrap.css("left")) : parseInt($scrollWrap.css("top")); if(tmpPosVal == 0 && n >0){scrollPause = false;return false;} if(tmpPosVal <= overPlus && !opt.cycle && n<0){scrollPause = false;return false;} if(opt.type == "x"){ $scrollWrap.animate({left:tmpPosVal + n*singleSize},opt.speed,function(){ checkPosition(tmpPosVal + n*singleSize,"x"); }); }else{ $scrollWrap.animate({top:tmpPosVal + n*singleSize},opt.speed,function(){ checkPosition(tmpPosVal + n*singleSize,"y"); }); } } //检测 var checkPosition = function(v,p){ scrollPause = false; if(opt.cycle){ if(v == 0){ if(p == "x"){ $scrollWrap.css("left",singleSize*ChildSize*(-1)); }else{ $scrollWrap.css("top",singleSize*ChildSize*(-1)); } } if(v <= singleSize*ChildSize*(-2)){ if(p == "x"){ $scrollWrap.css({left:singleSize*ChildSize*(-1)}); }else{ $scrollWrap.css({top:singleSize*ChildSize*(-1)}); } } } if(opt.auto && timeout != "mmover"){ clearInterval(timeout); timeout = window.setInterval(function(){ doanimate(-1); },opt.autotime) } } if(opt.auto){ var timeout = window.setInterval(function(){ doanimate(-1); },opt.autotime) } init(); } $.fn.dk_simplescroll.defaults = { type: "x", //滚动方向{x|y} 横向、纵向 默认x action: "single", //滚动方式{single|group}单张、组 默认single cycle: false, //是否循环 默认false auto: false, //是否自动播放,自动播放时cycle默认为true 默认false autotime: 3000, //自动播放间隔时间 默认为3000毫秒(3秒) speed: 500 //速度 300 默认500毫秒(5秒) } })(jQuery); //点击滑动JS function ShowTab(theA,Small,main){ for(var i=Small;i< main;i++ ){ document.getElementById('Tab'+i).style.display='none'; document.getElementById('Span'+i).className=''; } document.getElementById('Tab'+theA).style.display='block'; document.getElementById('Span'+theA).className='choose'; } window.pageConfig=window.pageConfig||{}; pageConfig.FN_ImgError=function(b){};