$(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("