⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bottom_20090120.js

📁 大图加小图的javascript特效
💻 JS
📖 第 1 页 / 共 2 页
字号:
var jq=jQuery;jq.noConflict();(function(){var lb=function(a,b){var c=a.fw;if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);if(c){d.unshift.apply(d,c)}
c=d}
b=a.hw||b;a=a.gw||a;var e,f=b||qa;if(c){e=function(){var g=Array.prototype.slice.call(arguments);g.unshift.apply(g,c);return a.apply(f,g)}}else{e=function(){return a.apply(f,arguments)}}
e.fw=c;e.hw=b;e.gw=a;return e};var ArraySlice=Array.prototype.slice;Function.prototype.bind=function(a){if(arguments.length>1){var b=ArraySlice.call(arguments,1);b.unshift(this,a);return lb.apply(null,b)}else{return lb(this,a)}};Function.prototype.partial=function(){var a=ArraySlice.call(arguments);a.unshift(this,null);return lb.apply(null,a)};Function.prototype.inherits=function(a){BV(this,a)};var BV=function(a,b){function c(){}
c.prototype=b.prototype;a.F=b.prototype;a.prototype=new c;a.prototype.constructor=a};Function.prototype.mixin=function(a,b){var P=this.prototype;if(typeof b=='undefined'){b=1}
if(b){for(var i in a){P[i]=a[i];}}else{for(var i in a){(!(i in P))&&(P[i]=a[i]);}}};})();function Dict(a){for(var i in a){this[i]=a[i];}}
Dict.mixin({"keys":function(){var b=[];for(var i in this){b.push(i);}
return b;},"values":function(){var b=[];for(var i in this){b.push(this[i]);}
return b;},"items":function(){var b=[];for(var i in this){b.push([i,this[i]]);}
return b;}});var PageBar={};var searchtype=1;PageBar.searchFormName="bar_search_form1";PageBar.switchSearchType=function(oi){if(!PageBar.searchTypeBtns){var btns=jq(oi).parent().find(">span.search-type");PageBar.searchTypeBtns={"video":btns.eq(0),"web":btns.eq(1)}
btns=null;}
var targetType=oi.getAttribute('rel');var theForm=document.forms[this.searchFormName];if(!targetType){targetType='video'}
if(targetType=="video"){PageBar.searchTypeBtns["video"].addClass("search-type-on");PageBar.searchTypeBtns["web"].removeClass("search-type-on");theForm["action"]="http://vsearch.cctv.com/";theForm["method"]="post";searchtype=2;jq("#btnSearch").val("视频搜索");}else if(targetType=="web"){PageBar.searchTypeBtns["video"].removeClass("search-type-on");PageBar.searchTypeBtns["web"].addClass("search-type-on");theForm["action"]="http://web.search.cctv.com/websearch.php";theForm["method"]="get";searchtype=1;jq("#btnSearch").val("网页搜索");}};PageBar.submitSearchForm=function(){try{var form1=document.forms[this.searchFormName];if(searchtype==1){form1.q.value=form1.text.value;}else if(searchtype==2){form1.content.value=form1.text.value;form1.title.value='';form1.from_date.value='';form1.to_date.value='';}
document.forms[this.searchFormName].submit();return false;}catch(e){return true;}};var Drag;(function(){var jq_b=jq.browser,ua=navigator.userAgent;var Browser=new Object();Browser.isMozilla=jq_b.mozilla;Browser.isIE=jq_b.msie;Browser.isGecko=ua.indexOf("Gecko")!=-1;Browser.isOpera=jq_b.opera;function fixE(a){if(typeof a=="undefined"){a=window.event;}
if(typeof a.layerX=="undefined")
a.layerX=a.offsetX;if(typeof a.layerY=="undefined")
a.layerY=a.offsetY;if(typeof a.which=="undefined")
a.which=a.button;if(!a.target&&a.srcElement)a.target=a.srcElement;if(jq.browser.safari&&a.target.nodeType==3)a.target=a.target.parentNode;return a}
function emptyFn(){}
var ig_d={obj:null,init:function(a,b){a.onmousedown=ig_d.start;a.obj=b;if(isNaN(parseInt(b.style.left,10)))
b.style.left="0px";if(isNaN(parseInt(b.style.top,10)))
b.style.top="0px";b.onDragStart=emptyFn;b.onDragEnd=emptyFn;b.onDrag=emptyFn;},uninit:function(a,b){window.clearInterval(b.qa);a.onmousedown=null;a.obj=null;b.onDragStart=null;b.onDragEnd=null;b.onDrag=null},start:function(a){a=fixE(a);if(a.target!=this){return}
var b=ig_d.obj=this.obj;if(a.which!=1){return true}
b.onDragStart(a);var c=a.clientY;if(!jq.browser.safari){c+=document.body.scrollTop}
b.lastMouseX=a.clientX;b.lastMouseY=c;b.offsetMouseX=parseInt(b.style.left,10)-a.clientX;b.offsetMouseY=parseInt(b.style.top,10)-c;document.onmouseup=ig_d.end;document.onmousemove=ig_d.drag;return false},drag:function(a){a=fixE(a);if(a.which==0){return ig_d.end()}
var b=ig_d.obj,c=a.clientY;if(!jq.browser.safari){c+=document.body.scrollTop}
var d=a.clientX;if(b.lastMouseX==d&&b.lastMouseY==c){return false}
var e=d+b.offsetMouseX,f=c+b.offsetMouseY;b.style.left=e+"px";b.style.top=f+"px";b.lastMouseX=d;b.lastMouseY=c;b.onDrag(e,f);return false},end:function(a){a=fixE(a);document.onmousemove=null;document.onmouseup=null;window.clearInterval(ig_d.obj.qa);var b=ig_d.obj.onDragEnd();ig_d.obj=null;return b}};Drag=ig_d;function movescrollbar(){var elem=Drag.obj;var body_clientHeight=getclientHeight();var body_scrollHeight=getscrollHeight();var body_scrollTop=document.body.scrollTop;var body_scrollvalue=body_scrollTop;var winvalue=elem.root.offsetTop;var body_Height=document.body.offsetHeight;var step=10;var winTop=body_clientHeight*0.05;var winDown=body_clientHeight-winTop;if(elem.lastMouseY<=winTop){winvalue=Math.max(0,elem.root.offsetTop-step);body_scrollvalue=Math.max(0,body_scrollTop-step);}else if(elem.lastMouseY>=winDown){winvalue=Math.min(body_scrollHeight-elem.offsetHeight,elem.root.offsetTop+step);body_scrollvalue=Math.min(body_scrollHeight-body_clientHeight,body_scrollTop+step);}
var ig_l=body_scrollvalue-body_scrollTop;if(ig_l!=0){if((body_scrollHeight-winvalue)<elem.root.offsetHeight)winvalue=body_scrollHeight-elem.root.offsetHeight;elem.root.style.top=winvalue+"px";document.body.scrollTop=body_scrollvalue;}}})();function getclientHeight(){if(window.innerHeight<document.body.clientHeight){return window.innerHeight}
return document.body.clientHeight}
function getscrollHeight(){if(document.body.scrollHeight>document.documentElement.clientHeight){return document.body.scrollHeight}
else{return document.documentElement.clientHeight}}
function updateDisplay(){}
if(jq.browser.opera||jq.browser.msie){(function(){updateDisplay=function(el){with(document.body){style.zoom="100%";style.zoom='';}};})();}
var _P='prototype';var hp={};hp.dragTip='\u79fb\u52a8/\u62c6\u5206\u7ec4\u5408\u4e00\u4e0b!\u5b9a\u5236\u5c5e\u4e8e\u81ea\u5df1\u7684CCTV.com \uff1a\uff09';hp.layout_cookiename=hp_layout_cookiename;hp.theme_cookiename=hp_theme_cookiename;hp.initfinish=0;hp.cols=[];hp.mds=[];hp.ctx=null;hp.mds.removeMd=function(md){var hpMdsLen=this.length;for(var i=0;i<hpMdsLen;i++){if(this[i]==md){this[i]=this[hpMdsLen-1]
this.length=hpMdsLen-1;return md;}}
return null;};function emptyfn(){}
hp.set_layout_default=function(t){if(t==='noconfirm'||confirm('\u786e\u8ba4\u6062\u590d\u9ed8\u8ba4\u5e03\u5c40\u5417\uff1f')){hp.cookie(hp.layout_cookiename,'');hp.cookie(hp.theme_cookiename,'');if(typeof layout_lstid=='number'&&layout_lstid!=NaN){hp.cookie(hp_layout_lstid_cookiename,layout_lstid);}
location.reload();}};hp.cookie=function(cn,cv){var args=Array.prototype.slice.apply(arguments),argsLen=args.length;if(argsLen==0){return''+document.cookie;}else if(argsLen==1){var Tp=';',c=cn+'=',d=String(document.cookie);for(var e=-1;(e=d.indexOf(c,e+1))>=0;){var f=e;while(--f>=0){var g=d.charAt(f);if(g==Tp){f=-1;break}}
if(f==-1){var h=d.indexOf(Tp,e);if(h<0){h=d.length}
return d.substring(e+c.length,h)}}
return null;}else{var now=new Date();now.setTime(now.getTime()+2592000000);document.cookie=''+cn+'='+cv+"; expires="+now.toGMTString();return hp.cookie(cn);}};hp.ca="HP_pageDivMaskId";hp.ba="HP_moduleDivMaskId";hp.va=function(a,b,c){hp.oa();b=jq('<div>&nbsp;</div>').css('height',document.body.offsetHeight).attr('id',hp.ca).appendTo(document.body)[0];if(0&&a&&a.Ia){c=b.cloneNode(true);b.id=hp.ba;b.style.height=a.a.offsetHeight-a.h.offsetHeight+"px";b.style.top=a.h.offsetHeight+"px";a.a.appendChild(b)}
return[b,c];};hp.oa=function(){var a=[hp.ba,hp.ca],c;for(var b=0;b<a.length;b++){c=document.getElementById(a[b]);if(c){c.parentNode.removeChild(c);}}
a=c=null;};hp.wa=function(a){for(var b=0;b<hp.mds.length;b++){var c=hp.mds[b];c.a.pagePosLeft=c.md.posInPage(true);c.a.boxWidth=c.a.offsetWidth;c.a.pagePosRight=c.a.pagePosLeft+c.a.boxWidth;c.a.boxHeight=c.a.offsetHeight;c.a.pagePosTop=c.md.posInPage(false);c.a.pagePosBottom=c.a.pagePosTop+c.a.boxHeight;}
var d=a.a.nextSibling,aRootHeight=a.a.offsetHeight+10;while(d){d.pagePosTop-=aRootHeight;d.pagePosBottom-=aRootHeight;d=d.nextSibling}};hp.Sa=function(){if(!hp.initfinish){return}
var lay={};_log('save layout S');hp.cols.each(function(idx,col){var colid=parseInt(col.id.substring(7),10),mids=[];jq('>div.md',col).each(function(idx,md){var dnd=md.DND_Module;if(dnd.type=='normal'){var mid=parseInt(dnd.h.id.substring(2),10);}else if(dnd.type=='tab'){mid=[];jq.each(dnd.subMds,function(idx,subMd){mid.push(parseInt(subMd.tab.find('h2')[0].id.substring(2),10));});mid.push(dnd.activeMd.tabIdx);}
mids.push(mid);});lay[colid]=mids;});hp.cookie(hp.layout_cookiename,json.stringify(lay));_log('save layout E');};function Module_P_uninit(){if(this.h){if(this.d){this.d.onclick=null;this.d.onmouseup=null;this.d=null}
Drag.uninit(this.h,this.a);this.a.onDragStart=null;this.a.onDrag=null;this.a.onDragEnd=null;this.h=null}
this.btnMin.unbind('click');this.btnDel.unbind('click');for(var i in this){if(this.hasOwnProperty(i)){this[i]=null;}}}
function Module_P__dragStart(a){hp.wa(this);this.origNextSibling=this.a.nextSibling;var b=divGhost,c=this.a.offsetHeight;c-=4;var d=this.a.offsetWidth,e=this.md.posInPage(true),f=this.md.posInPage(false);this.md.css('width',d-2);b.style.height=c+"px";this.a.parentNode.insertBefore(b,this.a.nextSibling);this.a.style.position="absolute";this.a.style.zIndex=10000;this.a.style.left=e+"px";this.a.style.top=f+"px";hp.va(this);this.v=false;updateDisplay();return false}
function Module_P__drag(a,b){if(!this.v){this.a.style.filter="alpha(opacity=60)";this.a.style.opacity=0.6;this.v=true;}
var c=null,d=100000000;var theA=this.a;this.inModule=null;var k=divGhost;var mousePosY=theA.lastMouseY+jq.getPageOffset()[1];for(var e=0;e<hp.mds.length;e++){var f=hp.mds[e],fa=f.a,g=a;if(this.lastInModule){divGhostForMerge.css('display','none');this.lastInModule=null;}
if(f!=this&&(this.type=='normal')&&(f.type=='normal'||f.type=='tab')&&theA.lastMouseX>=fa.pagePosLeft&&theA.lastMouseX<=fa.pagePosRight&&mousePosY>=(fa.pagePosTop+0)&&mousePosY<=(fa.pagePosBottom-0)){this.inModule=this.lastInModule=f;divGhostForMerge.css('display','').css('left',fa.pagePosLeft-2).css('top',fa.pagePosTop-2).css('width',fa.boxWidth).css('height',fa.boxHeight);if(k.parentNode!=null){updateDisplay();k.parentNode.removeChild(k);}
break;}
if(document.body.dir=="rtl"&&fa.offsetWidth==1){g+=theA.offsetWidth}
var h=Math.sqrt(Math.pow(g-fa.pagePosLeft,2)+Math.pow(b-fa.pagePosTop,2));if(f==this)
continue;if(isNaN(h))
continue;if(h<d){d=h;c=f}}
if(this.inModule===null&&c!==null&&k.nextSibling!=c.a){c.a.parentNode.insertBefore(k,c.a);updateDisplay();}}
function Module_P__dragEnd(){hp.oa();var needSave=0;if(this.Da()){needSave=1;}
if(this.inModule){divGhostForMerge.css('display','none');this.lastInModule=null;switch(this.inModule.type){case'normal':TabModule.fromModules(this.inModule,this);needSave=1;break;case'tab':this.inModule._addSubMd(this);needSave=1;break;}}
if(needSave){hp.Sa()}
return true}
function Module_P_Da(){var a=false;this.a.style.position="";this.a.style.width="";this.a.style.zIndex="";this.a.style.filter="";this.a.style.opacity="";window.scrollBy(0,0);var k=divGhost;if(k.parentNode!=null){if(k.nextSibling!=this.origNextSibling){k.parentNode.insertBefore(this.a,k.nextSibling);a=true;}
k.parentNode.removeChild(k);}
updateDisplay();return a}
function ModulePix(a){this.md=a;this.a=a[0];}
Module.mixin({type:"pix",uninit:function(){this.md=this.a=null}});function Module(a){this.v=false;this.md=a;this.a=a[0];this.a.DND_Module=this;this.init();}
Module.mixin({type:"normal",init:function(){this.cmh=this.md.find('>.mh');this.mh=this.cmh.find('>h2');this.h=this.mh[0];this.h.title=hp.dragTip;this.mb=this.md.find('>.mb');this.Ia=this.mb.find('iframe');if(this.Ia.length<1){delete this.Ia;}
this._minClick=this._minClick.bind(this);this._delClick=this._delClick.bind(this)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -