类google的上移和下移

<iframe name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-4490194096475053&amp;dt=1223179598965&amp;lmt=1219187847&amp;prev_slotnames=1891601125&amp;output=html&amp;slotname=3685991503&amp;correlator=1223179598825&amp;url=http%3A%2F%2Fwww.corange.cn%2Farchives%2F2008%2F05%2F1205.html&amp;ea=off&amp;ref=http%3A%2F%2Fwww.corange.cn%2Fhtml%2Fcorange__65.html&amp;frm=0&amp;cc=100&amp;ga_vid=1821700167.1223130124&amp;ga_sid=1223179457&amp;ga_hid=1387340393&amp;ga_fc=true&amp;flash=9.0.124.0&amp;u_h=768&amp;u_w=1024&amp;u_ah=738&amp;u_aw=1024&amp;u_cd=32&amp;u_tz=480&amp;u_his=2&amp;u_java=true" frameborder="0" width="300" scrolling="no" height="250" allowtransparency></iframe>
<METAhttp-equiv=Content-Typecontent="text/html;charset=utf-8">
<STYLE>
.a7container{FLOAT:left;WIDTH:385px;POSITION:relative}
.a2{FLOAT:left;WIDTH:385px;POSITION:relative;}
#rc4{BACKGROUND:#b3d580;LEFT:0px;WIDTH:100%;POSITION:absolute;TOP:0px}
#rc6{BACKGROUND:#99c9b1;LEFT:0px;WIDTH:100%;POSITION:absolute;TOP:100px}
#rc8{BACKGROUND:#b4a1d8;LEFT:0px;WIDTH:100%;POSITION:absolute;TOP:200px}
#rc5{BACKGROUND:#f7c480;LEFT:0px;WIDTH:100%;POSITION:absolute;TOP:0px}
#rc7{BACKGROUND:#d5d588;LEFT:0px;WIDTH:100%;POSITION:absolute;TOP:100px}
#rc9{BACKGROUND:#eea2bb;LEFT:0px;WIDTH:100%;POSITION:absolute;TOP:200px}
</STYLE>
<BODY>
<DIV><SPANid=sd_upstyle="VISIBILITY:hidden">上移</SPAN><SPANid=sd_down
style="VISIBILITY:hidden">下移</SPAN></DIV>
<DIVclass=a2style="MARGIN-RIGHT:0px!important">
<DIVid=rc4>
<DIVid=bt4></DIV>
</DIV>

<DIVid=rc6>
<DIVid=bt6></DIV>
</DIV>

<DIVid=rc8>
<DIVid=bt8></DIV>
</DIV>

</DIV>
<SCRIPT><!--
functions(a){if(ainy){returny[a]}returny[a]=navigator.userAgent.toLowerCase().indexOf(a)!=-1}vary={};functionH(){returns("msie")&&!window.opera}functionua(a){if(typeofError!="undefined"){thrownewError(a||"AssertionFailed");}else{throwa;}}functionda(a){if(a===undefined)a="Assertionfailed";if(t(L))L(a+"\n");ua(a)}functionY(a,b){if(!a){if(b===undefined)b="Assertionfailed";da(b)}};functionka(a,b,c,d,e){b=""+b;Y(typeofa=="string"&&typeofb=="string"&&!a.match(/[\s;]/)&&!b.match(/[\s;]/),
"tryingtosetaninvalidcookie");if(!t(c))c=-1;if(!t(d))d="/";if(!t(e))e=null;vari=e==null?"":";domain="+e,h=d==null?"":";path="+d,u;if(c<0){u=""}elseif(c==0){varfa=newDate(1970,1,1);u=";expires="+fa.toUTCString()}else{varga=newDate(O()+c*1000);u=";expires="+ga.toUTCString()}document.cookie=a+"="+b+i+h+u};functionea(a){varb=a+"=",c=String(document.cookie);for(vard=-1;(d=c.indexOf(b,d+1))>=0;){vare=d;while(--e>=0){vari=c.charAt(e);if(i==";"){e=-1;break}elseif("\t".indexOf(i)<0){break}}if(-1===
e){varh=c.indexOf(";",d);if(h<0){h=c.length}returnc.substring(d+b.length,h)}}return""}functionO(){return(newDate).getTime()}varla=/&/g,ra=/</g,qa=/>/g;functionN(a){if(!a)return"";returna.replace(la,"&amp;").replace(ra,"&lt;").replace(qa,"&gt;").replace(ta,"&quot;")}varta=/\"/g;functiont(a){returntypeofa!="undefined"}functionna(a){returndocument.getElementById(a)}functionoa(a){returndocument.all[a]}varma=document.getElementById?na:oa;functionX(a){try{if(window.parent!=window&&window.parent.log){window.parent.log(window.name+
"::"+a);return}}catch(b){}varc=ma("log");if(c){vard="<pclass=logentry><spanclass=logdate>"+newDate+"</span><spanclass=logmsg>"+a+"</span></p>";c.innerHTML=d+c.innerHTML}else{window.status=a}};varK=false;functionL(a){try{throwa;}catch(b){M(b)}}functionM(a,b){varc="Javascriptexception:"+(b?b:"")+""+a;if(H()){c+=""+a.name+":"+a.message+"("+a.number+")"}vard="";if(typeofa=="string"){d=a+"\n"}else{for(vareina){try{d+=e+":"+a[e]+"\n"}catch(i){}}}d+=I(M.caller);ba(c+"\n"+d,1)}varpa=/function(\w+)/;function$(a){varb=pa.exec(String(a));if(b){returnb[1]}return""}functionI(a){try{if(!H()&&!(s("safari")||s("konqueror"))&&s("mozilla")){returnError().stack}if(!a)return"";varb=
"-"+$(a)+"(";for(varc=0;c<a.arguments.length;c++){if(c>0)b+=",";vard=String(a.arguments[c]);if(d.length>40){d=d.substr(0,40)+"..."}b+=d}b+=")\n";b+=I(a.caller);returnb}catch(e){return"[Cannotgetstacktrace]:"+e+"\n"}}varca;varj=null,z=false;functionaa(){if((j==null||j.closed)&&!z){try{z=true;j=window.open("","debug","width=700,height=500,toolbar=no,resizable=yes,scrollbars=yes,left=16,top=16,screenx=16,screeny=16");j.blur();j.document.open();z=false;vara="<fontcolor=#ff0000><b>Toturnoffthisdebuggingwindow,hit'D'insidethemaincaribouwindow,thenclosethiswindow.</b></font><br>";
J(a)}catch(b){}}}functionba(a,b){if(!K){if(typeofX!="undefined"){X(N(a))}return}try{varc=O()-ca,d="["+c+"]"+N(a).replace(/\n/g,"<br>")+"<br>";if(b==1){d="<fontcolor=#ff0000><b>Error:"+d+"</b></font>";j.focus()}}catch(e){}J(d)}functionJ(a){if(!K){return}try{aa();j.document.write(a);j.scrollTo(0,1000000)}catch(b){}};varw=null,o=null,r=null,A=0,E=0,C=false,q=0,P=0,k=0,x=0,B=0,V,n=[0,100,200],l=0,g=[0,0,0,0,1,1,2,2,3,3],ha=(n[1]-n[0])/2;functionf(a){returndocument.getElementById(a)}functionm(a){return(a/2-1)%3*2+4}functionT(a,b,c,d){v(f("rc"+b),d);v(f("rc"+a),c);f("rc"+a).style["zIndex"]=9999;f("rc"+b).style["zIndex"]=9998}functionv(a,b){varc=a.style;if("opacity"inc){c.opacity=b}elseif("MozOpacity"inc){c.MozOpacity=b}elseif("KhtmlOpacity"inc){c.KhtmlOpacity=b}elseif("filter"inc){c.filter="alpha(opacity="+
b*100+")"}}functionU(a){varb=['<spanstyle="cursor:pointer"οnclick="_md('];b.push(a);b.push(')">');b.push(f("sd_down").innerHTML);b.push("<b>&darr;</b></span>");f("bt"+a).innerHTML=b.join("")}functionD(a){varb=['<spanstyle="cursor:pointer"οnclick="_mu('];b.push(a);b.push(')">');b.push(f("sd_up").innerHTML);b.push('<b>&uarr;</b></span><spanstyle="cursor:pointer"οnclick="_md(');b.push(a);b.push(')">');b.push(f("sd_down").innerHTML);b.push("<b>&darr;</b></span>");f("bt"+a).innerHTML=b.join("")}
functionS(a){varb=['<spanstyle="cursor:pointer"οnclick="_mu('];b.push(a);b.push(')">');b.push(f("sd_up").innerHTML);b.push("<b>&uarr;</b></span>");f("bt"+a).innerHTML=b.join("")}functionQ(a){returnparseInt(a.offsetTop,10)}functionp(a,b){a.style["top"]=b+"px"}functionR(a){if(w!=null){return}varb=g[a],c=b+1,d=m(a),e=g[d]==c?d:m(d);l=0;T(a,e,1,0.6);o=f("rc"+a);r=f("rc"+e);q=n[c-1];P=n[b-1];k=Q(o);x=Q(r);B=b;A=a;E=e;vari=g[a];g[a]=g[e];g[e]=i;ka("a","(["+g.toString()+"])",86400000,"/","daohang.google.cn");
ia();varh=32;C=false;V=window.setInterval(W,h);w=1}functionja(a){if(w!=null){return}varb=g[a],c=b-1,d=g[m(a)]==c?m(a):m(m(a));R(d);T(a,d,1,0.6)}functionia(){(newImage).src="/?ct=mov&cd="+g.join("")}functionW(){if(k<=q){if(k+5+l>=q){p(o,q);p(r,P);v(o,1);v(r,1);window.clearInterval(V);w=null;return}else{l+=2;p(o,k+5+l);p(r,x-5-l);k=k+5+l;x=x-5-l}}if(!C&&k>=q-ha){if(B==1){D(A);U(E)}elseif(B==2){S(A);D(E)}C=true}}var_md=R,_mu=ja,_sp=W;(function(){vara=ea("a");if(a!=0){g=eval(a)}varb=[U,D,S];
for(varc=4;c<10;c+=2){p(f("rc"+c),n[g[c]-1]);b[g[c]-1](c)}})();functionZ(a){returnfunction(){varb=a.id.split(":"),c,d=window.navigator.userAgent.indexOf("MSIE")!=-1;if(b.length==4){vare=window.encodeURIComponent?window.encodeURIComponent:window.escape,i=d?"T":"t";c=["http://www.google.cn/url?sa=",i,"&url=",e(a.href),"&usg=",b[0],"&ct=",b[1],"&cd=",b[2],"&cad=",b[3],"&source=shallowdir"]}elseif(b.length==3){c=[a.href,"?ct=",b[0],"&cd=",b[1],"&cad=",b[2]]}varh=c.join("");if(d){(newImage).src=h}else{a.href=h;a.οnmοusedοwn=""}returntrue}}if(document.images){varsa=
document.links.length;for(varF=0;F<sa;++F){varG=document.links[F];if(G.id){G.οnmοusedοwn=Z(G)}}};
//--></SCRIPT>
</BODY>
应用例子
<?xmlversion="1.0"encoding="gb2312"?>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title>Testpage</title>
<metaname="Author"content="mozart0"/>
<styletype="text/css">
/*<![CDATA[*/
ul{
width:400px
}
li{
border:1pxsolidgray;
list-style:none
}
.txt{
padding:4px;
background-color:#ffffff
}
/*]]>*/
</style>
<scriptlanguage="javascript"type="text/javascript">
//<![CDATA
window.οnlοad=function(){
ggGroup(document.getElementById('test'),5);
};
functionggGroup(ele,margin){
margin=margin||0;
varbgcolors='#b3d580,#99c9b1,#b4a1d8,#f7c480,#d5d588,#eea2bb'.split(',');
vartxtUp='上移↑&nbsp;',txtDown='下移↓';
varpanels=children(ele);
for(vari=0,h=0;i<panels.length;i++){
varp=panels[i];
p.style.position='absolute';
p.style.width='100%';
varb=document.createElement('div');
with(b.style){
fontSize='12px';
padding='4px';
backgroundColor=bgcolors[i%bgcolors.length];
textAlign='right';
}
b.innerHTML='<span>'+txtUp+'</span><span>'+txtDown+'</span>';
b.firstChild.οnclick=moveup;
b.firstChild.style.cursor='pointer';
b.lastChild.οnclick=movedown;
b.lastChild.style.cursor='pointer';
p.insertBefore(b,p.firstChild);
p.style.top=h+'px';
p.index=i;
h+=p.offsetHeight+margin;
}
ele.style.height=h+'px';
ele.style.position='relative';
check(0,i-1);
functioncheck(){
for(vari=0;i<arguments.length;i++){
varx=arguments[i];
varc=panels[x].firstChild.childNodes;
c[0].style.visibility=x==0?'hidden':'visible';
c[1].style.visibility=x==panels.length-1?'hidden':'visible';
panels[x].index=x;
}
}
functionmoveup(evt){
varp=evt?evt.target:event.srcElement;
p=p.parentNode.parentNode;
swap(p,panels[p.index-1]);
}
functionmovedown(evt){
varp=evt?evt.target:event.srcElement;
p=p.parentNode.parentNode;
swap(p,panels[p.index+1]);
}
functionswap(p1,p2){
varN=10;
varINTV=200;
vararr1,arr2;
vart1=parseInt(p1.style.top),t2=parseInt(p2.style.top);
varh1=p1.offsetHeight+margin,h2=p2.offsetHeight+margin;
arr1=makeArr(t1,t1<t2?h2:-h2);
arr2=makeArr(t2,t1<t2?-h1:h1);
for(vari=0;i<N;i++)(function(){
varj=i;
setTimeout(function(){
p1.style.top=arr1[j]+"px";
p2.style.top=arr2[j]+"px";
if(j==N-1){
panels[p1.index]=p2;
panels[p2.index]=p1;
check(p1.index,p2.index);
}
},(j+1)*INTV/N);
})();
functionmakeArr(f,x){
varret=[];
for(vari=0;i<N;i++)
ret[i]=Math.round(f+i*x/(N-1));
returnret;
}
}
functionchildren(e){
varret=[];
for(vari=0,c=e.childNodes;i<c.length;i++)
if(c[i].nodeType==1)
ret.push(c[i]);
returnret;
}
}
//]]>
</script>
</head>
<body>
<ulid="test">
<li>
<divclass="txt"><h2>Hello<br/>baby</h2></div></li>
<li>
<divclass="txt">
<imgsrc="http://pages.blueidea.com/articleimg/2007/01/1403/preview_s01.jpg"/>
</div></li>
<li>
<divclass="txt">
<i>人之初,性本善</i>
</div></li>
<li>
<divclass="txt">
maybeyouareright<br/>maybe<br/>...<br/>butidon'tunderstand
</div></li>
</ul>
</body>
</html>
===========
带位置保存到本地cookise
<?xmlversion="1.0"encoding="gb2312"?>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title>Testpage</title>
<metaname="Author"content="mozart0"/>
<styletype="text/css">
/*<![CDATA[*/
ul{
width:400px
}
li{
border:1pxsolidgray;
list-style:none
}
.txt{
padding:4px;
background-color:#ffffff
}
.title{
font:bold14px/20pxverdana;
position:absolute;
top:0px;
}
/*]]>*/
</style>
<scriptlanguage="javascript"type="text/javascript">
//<![CDATA
window.οnlοad=function(){
varg=ggGroup(document.getElementById('test'),5,true);
//vara=g.serialize();
//g.setup(a.reverse());
};
functionggGroup(ele,margin,useCookie){
//
//bymozart0,2007.06.09
//
margin=margin||0;
varbgcolors='#b3d580,#99c9b1,#b4a1d8,#f7c480,#d5d588,#eea2bb'.split(',');
vartxtUp='上移↑&nbsp;',txtDown='下移↓&nbsp;';
varpanels=children(ele);
for(vari=0;i<panels.length;i++){
varp=panels[i];
p.style.position='absolute';
p.style.width='100%';
varb=document.createElement('div');
with(b.style){
fontSize='12px';
lineHeight='20px';
backgroundColor=bgcolors[i%bgcolors.length];
textAlign='right';
}
b.innerHTML='<span>'+txtUp+'</span><span>'+txtDown+'</span>';
b.firstChild.οnclick=moveup;
b.firstChild.style.cursor='pointer';
b.lastChild.οnclick=movedown;
b.lastChild.style.cursor='pointer';
p.insertBefore(b,p.firstChild);
}
varretObj={
save:function(){
setCookie('gg_'+ele.id,
retObj.serialize().join(','),7*24);
},
load:function(){
vara=getCookie('gg_'+ele.id);
retObj.setup(a?a.split(','):null);
},
serialize:function(){
for(vari=0,a=[],c=children(ele);i<c.length;i++)
a.push(c[i].index);
returna;
},
setup:function(a){
varc=children(ele);
if(a&&a.length==c.length){
panels=newArray(c.length);
for(vari=0;i<a.length;i++)
panels[a[i]]=c[i];
}
for(vari=0,h=0,c=[];i<panels.length;i++){
panels[i].style.top=h+'px';
h+=panels[i].offsetHeight+margin;
c.push(i);
}
check.apply(null,c);
ele.style.height=h+'px';
ele.style.position='relative';
}
};
if(useCookie){
retObj.load();
window.attachEvent?
window.attachEvent('onunload',retObj.save):
window.addEventListener('unload',retObj.save,false);
}
else
retObj.setup(null);
returnretObj;
functionsetCookie(name,value,expires){
varx=name+"="+escape(value);
if(expires){
vard=newDate();
d.setTime(d.getTime()+expires*24*3600*1000);
x+=";Expires="+d.toGMTString();
}
document.cookie=x;
}
functiongetCookie(name){
vara=document.cookie.split(";");
name+="=";
for(vari=0;i<a.length;i++)
if(a[i].indexOf(name)==0)
returnunescape(a[i].substr(name.length));
return"";
}
functioncheck(){
for(vari=0;i<arguments.length;i++){
varx=arguments[i];
varc=panels[x].firstChild.childNodes;
c[0].style.display=x==0?'none':'';
c[1].style.display=x==panels.length-1?'none':'';
panels[x].index=x;
}
}
functionmoveup(evt){
varp=evt?evt.target:event.srcElement;
p=p.parentNode.parentNode;
swap(p,panels[p.index-1]);
}
functionmovedown(evt){
varp=evt?evt.target:event.srcElement;
p=p.parentNode.parentNode;
swap(p,panels[p.index+1]);
}
functionswap(p1,p2){
varN=10;
varINTV=200;
vararr1,arr2;
vart1=parseInt(p1.style.top),t2=parseInt(p2.style.top);
varh1=p1.offsetHeight+margin,h2=p2.offsetHeight+margin;
arr1=makeArr(t1,t1<t2?h2:-h2);
arr2=makeArr(t2,t1<t2?-h1:h1);
for(vari=0;i<N;i++)(function(){
varj=i;
setTimeout(function(){
p1.style.top=arr1[j]+"px";
p2.style.top=arr2[j]+"px";
if(j==N-1){
panels[p1.index]=p2;
panels[p2.index]=p1;
check(p1.index,p2.index);
}
},(j+1)*INTV/N);
})();
functionmakeArr(f,x){
varret=[];
for(vari=0;i<N;i++)
ret[i]=Math.round(f+i*x/(N-1));
returnret;
}
}
functionchildren(e){
varret=[];
for(vari=0,c=e.childNodes;i<c.length;i++)
if(c[i].nodeType==1)
ret.push(c[i]);
returnret;
}
}
//]]>
</script>
</head>
<body>
<ulid="test">
<li>
<divclass="txt">
<divclass="title">TitleA</div>
<h2>Hello<br/>baby</h2></div></li>
<li>
<divclass="txt">
<divclass="title">TitleB</div>
<imgsrc="http://pages.blueidea.com/articleimg/2007/01/1403/preview_s01.jpg"/>
</div></li>
<li>
<divclass="txt">
<divclass="title">TitleC</div>
<i>人之初,性本善</i>
</div></li>
<li>
<divclass="txt">
<divclass="title">TitleD</div>
maybeyouareright<br/>maybe<br/>...<br/>butidon'tunderstand
</div></li>
</ul>
</body>
</html>
  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值