这个功能是怎么实现的?

lyp71887188 2009-11-19 11:02:09
http://www.sd-66.com/show.php?cid=&attid=1124
上面这个网址,点”放大“后弹出的内容是怎么实现的啊。是js做的吗?给个思路或贴出相关代码。谢谢啦。。
...全文
91 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhouqiyong 2009-11-19
  • 打赏
  • 举报
回复
js做的
代码就在里面.
找一下就找到了.
像这样的代码太多了..
oldjiang 2009-11-19
  • 打赏
  • 举报
回复
字数太多,接上。


],i,5)},65:7(C,G){c 2L=[];t(c i=0,j=5.L;i<j;i++){h(C.1K(G,5[i],i,5))2L.1i(5[i])}6 2L},1N:7(C,G){c 2L=[];t(c i=0,j=5.L;i<j;i++)2L[i]=C.1K(G,5[i],i,5);6 2L},3K:7(C,G){t(c i=0,j=5.L;i<j;i++){h(!C.1K(G,5[i],i,5))6 U}6 1c},7T:7(C,G){t(c i=0,j=5.L;i<j;i++){h(C.1K(G,5[i],i,5))6 1c}6 U},30:7(1U,B){c 2Z=5.L;t(c i=(B<0)?1m.1H(0,2Z+B):B||0;i<2Z;i++){h(5[i]===1U)6 i}6-1},5G:7(1d,L){1d=1d||0;h(1d<0)1d=5.L+1d;L=L||(5.L-1d);c 4n=[];t(c i=0;i<L;i++)4n[i]=5[1d++];6 4n},2t:7(1U){c i=0;c 2Z=5.L;4H(i<2Z){h(5[i]===1U){5.3L(i,1);2Z--}T{i++}}6 5},18:7(1U,B){6 5.30(1U,B)!=-1},7V:7(1f){c I={},L=1m.2w(5.L,1f.L);t(c i=0;i<L;i++)I[1f[i]]=5[i];6 I},K:7(12){t(c i=0,j=12.L;i<j;i++)5.1i(12[i]);6 5},2X:7(12){t(c i=0,l=12.L;i<l;i++)5.4f(12[i]);6 5},4f:7(1U){h(!5.18(1U))5.1i(1U);6 5},7G:7(){6 5[$4G(0,5.L-1)]||1a},67:7(){6 5[5.L-1]||1a}});1q.19.1w=1q.19.44;1q.1w=1q.44;7 $A(12){6 1q.5G(12)};7 $1w(2j,C,G){h(2j&&3C 2j.L==\'3V\'&&$m(2j)!=\'2e\'){1q.44(2j,C,G)}T{t(c 1y R 2j)C.1K(G||2j,2j[1y],1y)}};1q.19.1Z=1q.19.18;4S.K({1Z:7(4c,5F){6(($m(4c)==\'1Y\')?V 4V(4c,5F):4c).1Z(5)},2f:7(){6 3c(5,10)},5J:7(){6 3p(5)},4M:7(){6 5.2h(/-\\D/g,7(26){6 26.4A(1).5E()})},69:7(){6 5.2h(/\\w[A-Z]/g,7(26){6(26.4A(0)+\'-\'+26.4A(1).3r())})},5a:7(){6 5.2h(/\\b[a-z]/g,7(26){6 26.5E()})},5D:7(){6 5.2h(/^\\s+|\\s+$/g,\'\')},55:7(){6 5.2h(/\\s{2,}/g,\' \').5D()},3D:7(12){c 1C=5.26(/\\d{1,3}/g);6(1C)?1C.3D(12):U},3X:7(12){c 2z=5.26(/^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$/);6(2z)?2z.5M(1).3X(12):U},18:7(1Y,s){6(s)?(s+5+s).30(s+1Y+s)>-1:5.30(1Y)>-1},7Y:7(){6 5.2h(/([.*+?^${}()|[\\]\\/\\\\])/g,\'\\\\$1\')}});1q.K({3D:7(12){h(5.L<3)6 U;h(5.L==4&&5[3]==0&&!12)6\'8c\';c 2z=[];t(c i=0;i<3;i++){c 2Q=(5[i]-0).8b(16);2z.1i((2Q.L==1)?\'0\'+2Q:2Q)}6 12?2z:\'#\'+2z.1O(\'\')},3X:7(12){h(5.L!=3)6 U;c 1C=[];t(c i=0;i<3;i++){1C.1i(3c((5[i].L==1)?5[i]+5[i]:5[i],16))}6 12?1C:\'1C(\'+1C.1O(\',\')+\')\'}});4O.K({1I:7(q){c C=5;q=$2X({\'G\':C,\'r\':U,\'J\':1a,\'1s\':U,\'2H\':U,\'3Z\':U},q);h($2P(q.J)&&$m(q.J)!=\'12\')q.J=[q.J];6 7(r){c P;h(q.r){r=r||M.r;P=[(q.r===1c)?r:V q.r(r)];h(q.J)P.K(q.J)}T P=q.J||J;c 22=7(){6 C.2F($4t(q.G,C),P)};h(q.1s)6 8d(22,q.1s);h(q.2H)6 8e(22,q.2H);h(q.3Z)4o{6 22()}4d(8h){6 U};6 22()}},8g:7(P,G){6 5.1I({\'J\':P,\'G\':G})},3Z:7(P,G){6 5.1I({\'J\':P,\'G\':G,\'3Z\':1c})()},G:7(G,P){6 5.1I({\'G\':G,\'J\':P})},89:7(G,P){6 5.1I({\'G\':G,\'r\':1c,\'J\':P})},1s:7(1s,G,P){6 5.1I({\'1s\':1s,\'G\':G,\'J\':P})()},2H:7(5L,G,P){6 5.1I({\'2H\':5L,\'G\':G,\'J\':P})()}});5K.K({2f:7(){6 3c(5)},5J:7(){6 3p(5)},6u:7(2w,1H){6 1m.2w(1H,1m.1H(2w,5))},31:7(3l){3l=1m.86(10,3l||0);6 1m.31(5*3l)/3l},7y:7(C){t(c i=0;i<5;i++)C(i)}});c E=V 1e({1r:7(k,1b){h($m(k)==\'1Y\'){h(M.1J&&1b&&(1b.1y||1b.m)){c 1y=(1b.1y)?\' 1y="\'+1b.1y+\'"\':\'\';c m=(1b.m)?\' m="\'+1b.m+\'"\':\'\';4x 1b.1y;4x 1b.m;k=\'<\'+k+1y+m+\'>\'}k=N.5C(k)}k=$(k);6(!1b||!k)?k:k.1P(1b)}});c 2b=V 1e({1r:7(Q){6(Q)?$K(Q,5):5}});2b.K=7(1b){t(c 1g R 1b){5.19[1g]=1b[1g];5[1g]=$2U.3Q(1g)}};7 $(k){h(!k)6 1a;h(k.2J)6 1t.2I(k);h([M,N].18(k))6 k;c m=$m(k);h(m==\'1Y\'){k=N.7b(k);m=(k)?\'F\':U}h(m!=\'F\')6 1a;h(k.2J)6 1t.2I(k);h([\'2e\',\'7a\'].18(k.5X.3r()))6 k;$K(k,E.19);k.2J=7(){};6 1t.2I(k)};N.5B=N.3E;7 $$(){c Q=[];t(c i=0,j=J.L;i<j;i++){c 2V=J[i];1Q($m(2V)){Y\'F\':Q.1i(2V);Y\'7e\':1z;Y U:1z;Y\'1Y\':2V=N.5B(2V,1c);4Q:Q.K(2V)}}6 $$.56(Q)};$$.56=7(12){c Q=[];t(c i=0,l=12.L;i<l;i++){h(12[i].$42)5m;c F=$(12[i]);h(F&&!F.$42){F.$42=1c;Q.1i(F)}}t(c n=0,d=Q.L;n<d;n++)Q[n].$42=1a;6 V 2b(Q)};2b.41=7(o){6 7(){c P=J;c 3R=[];c Q=1c;t(c i=0,j=5.L,22;i<j;i++){22=5[i][o].2F(5[i],P);h($m(22)!=\'F\')Q=U;3R.1i(22)};6(Q)?$$.56(3R):3R}};E.K=7(1S){t(c o R 1S){3j.19[o]=1S[o];E.19[o]=1S[o];E[o]=$2U.3Q(o);c 5t=(1q.19[o])?o+\'2b\':o;2b.19[5t]=2b.41(o)}};E.K({1P:7(1b){t(c 1g R 1b){c 3b=1b[1g];1Q(1g){Y\'6q\':5.5N(3b);1z;Y\'H\':h(5.4i)5.4i(3b);1z;Y\'1S\':5.5R(3b);1z;4Q:5.3J(1g,3b)}}6 5},2B:7(k,5r){k=$(k);1Q(5r){Y\'5v\':k.2p.4P(5,k);1z;Y\'5w\':c 3h=k.68();h(!3h)k.2p.4X(5);T k.2p.4P(5,3h);1z;Y\'1T\':c 4N=k.4r;h(4N){k.4P(5,4N);1z}4Q:k.4X(5)}6 5},7A:7(k){6 5.2B(k,\'5v\')},71:7(k){6 5.2B(k,\'5w\')},7t:7(k){6 5.2B(k,\'4W\')},7n:7(k){6 5.2B(k,\'1T\')},6Z:7(){c Q=[];$1w(J,7(5A){Q=Q.7m(5A)});$$(Q).2B(5);6 5},2t:7(){6 5.2p.5Q(5)},7o:7(5z){c k=$(5.7p(5z!==U));h(!k.$H)6 k;k.$H={};t(c m R 5.$H)k.$H[m]={\'1f\':$A(5.$H[m].1f),\'1n\':$A(5.$H[m].1n)};6 k.3w()},7r:7(k){k=$(k);5.2p.7q(k,5);6 k},5P:7(25){5.4X(N.7j(25));6 5},4F:7(1k){6 5.1k.18(1k,\' \')},5x:7(1k){h(!5.4F(1k))5.1k=(5.1k+\' \'+1k).55();6 5},5q:7(1k){5.1k=5.1k.2h(V 4V(\'(^|\\\\s)\'+1k+\'(?:\\\\s|$)\'),\'$1\').55();6 5},8n:7(1k){6 5.4F(1k)?5.5q(1k):5.5x(1k)},2g:7(o,O){1Q(o){Y\'1u\':6 5.63(3p(O));Y\'9f\':o=(M.1J)?\'9c\':\'9S\'}o=o.4M();1Q($m(O)){Y\'3V\':h(![\'9o\',\'61\'].18(o))O+=\'33\';1z;Y\'12\':O=\'1C(\'+O.1O(\',\')+\')\'}5.15[o]=O;6 5},5N:7(2n){1Q($m(2n)){Y\'2e\':E.3F(5,\'2g\',2n);1z;Y\'1Y\':5.15.4u=2n}6 5},63:7(1u){h(1u==0){h(5.15.3s!="4C")5.15.3s="4C"}T{h(5.15.3s!="62")5.15.3s="62"}h(!5.3H||!5.3H.9u)5.15.61=1;h(M.1J)5.15.65=(1u==1)?\'\':"9r(1u="+1u*9k+")";5.15.1u=5.$2l.1u=1u;6 5},1B:7(o){o=o.4M();c 17=5.15[o];h(!$2P(17)){h(o==\'1u\')6 5.$2l.1u;17=[];t(c 15 R E.2c){h(o==15){E.2c[15].1w(7(s){c 15=5.1B(s);17.1i(3c(15)?15:\'5b\')},5);h(o==\'2a\'){c 3K=17.3K(7(2Q){6(2Q==17[0])});6(3K)?17[0]:U}6 17.1O(\' \')}}h(o.18(\'2a\')){h(E.2c.2a.18(o)){6[\'5k\',\'4w\',\'4h\'].1N(7(p){6 5.1B(o+p)},5).1O(\' \')}T h(E.59.18(o)){6[\'5c\',\'5i\',\'5j\',\'5l\'].1N(7(p){6 5.1B(\'2a\'+p+o.2h(\'2a\',\'\'))},5).1O(\' \')}}h(N.66)17=N.66.9d(5,1a).9e(o.69());T h(5.3H)17=5.3H[o]}h(M.1J)17=E.6a(o,17,5);h(17&&o.1Z(/3Y/i)&&17.18(\'1C\')){6 17.6m(\'1C\').3L(1,4).1N(7(3Y){6 3Y.3D()}).1O(\' \')}6 17},6R:7(){6 E.4K(5,\'1B\',J)},3k:7(3G,1d){3G+=\'9M\';c k=(1d)?5[1d]:5[3G];4H(k&&$m(k)!=\'F\')k=k[3G];6 $(k)},9L:7(){6 5.3k(\'2k\')},68:7(){6 5.3k(\'3h\')},9O:7(){6 5.3k(\'3h\',\'4r\')},67:7(){6 5.3k(\'2k\',\'9I\')},9H:7(){6 $(5.2p)},9A:7(){6 $$(5.60)},4U:7(k){6!!$A(5.3E(\'*\')).18(k)},4p:7(o){c 28=E.3S[o];h(28)6 5[28];c 4E=E.5g[o]||0;h(!M.1J||4E)6 5.9z(o,4E);c 4k=5.9y[o];6(4k)?4k.5S:1a},9x:7(o){c 28=E.3S[o];h(28)5[28]=\'\';T 5.9B(o);6 5},9C:7(){6 E.4K(5,\'4p\',J)},3J:7(o,O){c 28=E.3S[o];h(28)5[28]=O;T 5.9E(o,O);6 5},5R:7(2n){6 E.3F(5,\'3J\',2n)},5V:7(){5.5U=$A(J).1O(\'\');6 5},98:7(25){c 29=5.4y();h([\'15\',\'3v\'].18(29)){h(M.1J){h(29==\'15\')5.5T.4u=25;T h(29==\'3v\')5.3J(\'25\',25);6 5}T{5.5Q(5.4r);6 5.5P(25)}}5[$3x(5.4s)?\'4s\':\'5Y\']=25;6 5},8y:7(){c 29=5.4y();h([\'15\',\'3v\'].18(29)){h(M.1J){h(29==\'15\')6 5.5T.4u;T h(29==\'3v\')6 5.4p(\'25\')}T{6 5.5U}}6($4t(5.4s,5.5Y))},4y:7(){6 5.5X.3r()},2i:7(){1t.4b(5.3E(\'*\'));6 5.5V(\'\')}});E.6a=7(o,17,F){h($2P(3c(17)))6 17;h([\'45\',\'2O\'].18(o)){c 1n=(o==\'2O\')?[\'24\',\'4Y\']:[\'1T\',\'4W\'];c 2A=0;1n.1w(7(O){2A+=F.1B(\'2a-\'+O+\'-2O\').2f()+F.1B(\'4l-\'+O).2f()});6 F[\'21\'+o.5a()]-2A+\'33\'}T h(o.1Z(/2a(.+)5k|1L|4l/)){6\'5b\'}6 17};E.2c={\'2a\':[],\'4l\':[],\'1L\':[]};[\'5c\',\'5i\',\'5j\',\'5l\'].1w(7(5p){t(c 15 R E.2c)E.2c[15].1i(15+5p)});E.59=[\'8M\',\'8P\',\'8Q\'];E.4K=7(k,48,1f){c 17={};$1w(1f,7(1E){17[1E]=k[48](1E)});6 17};E.3F=7(k,48,4R){t(c 1E R 4R)k[48](1E,4R[1E]);6 k};E.3S=V 2K({\'5o\':\'1k\',\'t\':\'8K\',\'8N\':\'92
oldjiang 2009-11-19
  • 打赏
  • 举报
回复
接上、。
这是两个不同的文件。


//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006-2007 Valerio Proietti, <http://mad4milk.net>, MIT Style License.

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('c 7l={7B:\'1.11\'};7 $3x(I){6(I!=5O)};7 $m(I){h(!$3x(I))6 U;h(I.2J)6\'F\';c m=3C I;h(m==\'2e\'&&I.7z){1Q(I.4L){Y 1:6\'F\';Y 3:6(/\\S/).1Z(I.5S)?\'7v\':\'7w\'}}h(m==\'2e\'||m==\'7\'){1Q(I.5s){Y 1q:6\'12\';Y 4V:6\'7k\';Y 1e:6\'5o\'}h(3C I.L==\'3V\'){h(I.1U)6\'7C\';h(I.5H)6\'J\'}}6 m};7 $2X(){c 3q={};t(c i=0;i<J.L;i++){t(c o R J[i]){c 3y=J[i][o];c 47=3q[o];h(47&&$m(3y)==\'2e\'&&$m(47)==\'2e\')3q[o]=$2X(47,3y);T 3q[o]=3y}}6 3q};c $K=7(){c P=J;h(!P[1])P=[5,P[0]];t(c o R P[1])P[0][o]=P[1][o];6 P[0]};c $2U=7(){t(c i=0,l=J.L;i<l;i++){J[i].K=7(1b){t(c 1g R 1b){h(!5.19[1g])5.19[1g]=1b[1g];h(!5[1g])5[1g]=$2U.3Q(1g)}}}};$2U.3Q=7(1g){6 7(G){6 5.19[1g].2F(G,1q.19.5M.1K(J,1))}};$2U(4O,1q,4S,5K);7 $2P(I){6!!(I||I===0)};7 $4t(I,5W){6 $3x(I)?I:5W};7 $4G(2w,1H){6 1m.77(1m.4G()*(1H-2w+1)+2w)};7 $1V(){6 V 74().72()};7 $6w(1A){79(1A);7g(1A);6 1a};c 2K=7(I){I=I||{};I.K=$K;6 I};c 7h=V 2K(M);c 7i=V 2K(N);N.5Z=N.3E(\'5Z\')[0];M.64=!!(N.7d);h(M.8i)M.1J=M[M.85?\'7D\':\'5y\']=1c;T h(N.60&&!N.84&&!83.7Z)M.2N=M[M.64?\'82\':\'43\']=1c;T h(N.88!=1a)M.52=1c;M.8f=M.2N;8a.K=$K;h(3C 3j==\'5O\'){c 3j=7(){};h(M.2N)N.5C("7J");3j.19=(M.2N)?M["[[7H.19]]"]:{}}3j.19.2J=7(){};h(M.5y)4o{N.7U("7W",U,1c)}4d(e){};c 1e=7(1S){c 3i=7(){6(J[0]!==1a&&5.1r&&$m(5.1r)==\'7\')?5.1r.2F(5,J):5};$K(3i,5);3i.19=1S;3i.5s=1e;6 3i};1e.2i=7(){};1e.19={K:7(1S){c 3W=V 5(1a);t(c o R 1S){c 5u=3W[o];3W[o]=1e.5I(5u,1S[o])}6 V 1e(3W)},6c:7(){t(c i=0,l=J.L;i<l;i++)$K(5.19,J[i])}};1e.5I=7(2k,2v){h(2k&&2k!=2v){c m=$m(2v);h(m!=$m(2k))6 2v;1Q(m){Y\'7\':c 4v=7(){5.1j=J.5H.1j;6 2v.2F(5,J)};4v.1j=2k;6 4v;Y\'2e\':6 $2X(2k,2v)}}6 2v};c 6d=V 1e({7R:7(C){5.2D=5.2D||[];5.2D.1i(C);6 5},6Q:7(){h(5.2D&&5.2D.L)5.2D.6Y().1s(10,5)},7Q:7(){5.2D=[]}});c 20=V 1e({1M:7(m,C){h(C!=1e.2i){5.$H=5.$H||{};5.$H[m]=5.$H[m]||[];5.$H[m].4f(C)}6 5},2d:7(m,P,1s){h(5.$H&&5.$H[m]){5.$H[m].1w(7(C){C.1I({\'G\':5,\'1s\':1s,\'J\':P})()},5)}6 5},49:7(m,C){h(5.$H&&5.$H[m])5.$H[m].2t(C);6 5}});c 6f=V 1e({4D:7(){5.q=$2X.2F(1a,[5.q].K(J));h(5.1M){t(c 36 R 5.q){h($m(5.q[36]==\'7\')&&(/^4j[A-Z]/).1Z(36))5.1M(36,5.q[36])}}6 5}});1q.K({44:7(C,G){t(c i=0,j=5.L;i<j;i++)C.1K(G,5[i
oldjiang 2009-11-19
  • 打赏
  • 举报
回复
他的代码,直接COPY来的。
调用直接用链接就可以了。


/**
* LightBox On MooTools Release 1.0.0
* Modified And Bug Fixed By Zarknight
*/
var LightBox = {

init: function(options) {
options = Object.extend({
resizeDuration: 500,
initialWidth: 100,
initialHeight: 100
}, options || {});

this.anchors = [];
$$('a').each(function(el){
var rel = el.getProperty('rel');
if(rel && el.getProperty('href') && rel.test('^lightbox', 'i')) {
el.onclick = this.click.pass(el, this);
this.anchors.push(el);
}
}, this);

this.overlay = new Element('div').setProperty('id', 'lbOverlay').injectInside(document.body);
this.center = new Element('div').setProperty('id', 'lbCenter').setStyles({width: options.initialWidth+'px', height: options.initialHeight+'px', marginLeft: '-'+(options.initialWidth/2)+'px', display: 'none'}).injectInside(document.body);
this.image = new Element('div').setProperty('id', 'lbImage').injectInside(this.center);

this.prevLink = new Element('a').setProperties({id: 'lbPrevLink', href: '#'}).setStyle('display', 'none').injectInside(this.image);
this.nextLink = this.prevLink.clone().setProperty('id', 'lbNextLink').injectInside(this.image);
this.prevLink.onclick = this.previous.bind(this);
this.nextLink.onclick = this.next.bind(this);

this.bottom = new Element('div').setProperty('id', 'lbBottom').setStyle('display', 'none').injectInside(document.body);
this.caption = new Element('div').setProperty('id', 'lbCaption').injectInside(this.bottom);
this.number = new Element('div').setProperty('id', 'lbNumber').injectInside(this.bottom);
new Element('a').setProperties({id: 'lbCloseLink', href: '#'}).injectInside(this.bottom).onclick = this.overlay.onclick = this.close.bind(this);
new Element('div').setStyle('clear', 'both').injectInside(this.bottom);

var nextEffect = this.nextEffect.bind(this);
this.fx = {
overlay: this.overlay.effect('opacity', {duration: 500}).hide(),
resize: this.center.effects({duration: options.resizeDuration, onComplete: nextEffect}),
image: this.image.effect('opacity', {duration: 500, onComplete: nextEffect}),
bottom: this.bottom.effects({duration: 400, onComplete: nextEffect})
};

this.preloadPrev = new Image();
this.preloadNext = new Image();

this.eventKeyDown = this.keyboardListener.bindAsEventListener(this);
},

click: function(imageLink) {
var imageLinkRel = imageLink.getProperty('rel');
var imageLinkHref = imageLink.getProperty('href');
if(imageLinkRel.length == 8){
return this.show(imageLinkHref, imageLink.getProperty('title'));
}

var j, elHref, imageNum;
var images = [];
this.anchors.each(function(el){
elHref = el.getProperty('href');
if(el.getProperty('rel') == imageLinkRel) {
for(j = 0; j < images.length; j++)
if(images[j][0] == elHref) break;
if(j == images.length) {
images.push([elHref, el.getProperty('title')]);
if(elHref == imageLinkHref) imageNum = j;
}
}
}, this);
return this.open(images, imageNum);
},

show: function(url, title) {
return this.open([[url, title]], 0);
},

open: function(images, imageNum) {
this.images = images;
this.fixes(true);
var windowHeight = Window.getHeight();
var scrollHeight = Window.getScrollHeight();
this.overlay.setStyle('height', ((scrollHeight < windowHeight) ? windowHeight : scrollHeight)+'px');
this.fx.overlay.set(0.8);
this.top = Window.getScrollTop() + (windowHeight / 15);
this.center.setStyles({top: this.top+'px', display: ''});
document.addEvent('keydown', this.eventKeyDown);
return this.changeImage(imageNum);
},

fixes: function(open) {
var elements = $$('object');
if(window.ie) elements.extend($$('select'));
elements.each(function(el){
el.setStyle('visibility',(open ? 'hidden' : ''));
});
},

keyboardListener: function(event) {
switch(event.keyCode) {
case 27: case 88: case 67: this.close(); break;
case 37: case 80: this.previous(); break;
case 39: case 78: this.next();
}
},

previous: function() {
return this.changeImage(this.activeImage-1);
},

next: function() {
return this.changeImage(this.activeImage+1);
},

changeImage: function(imageNum) {
if(this.step || (imageNum < 0) || (imageNum >= this.images.length)) return false;
this.step = 1;
this.activeImage = imageNum;

this.prevLink.style.display = this.nextLink.style.display = 'none';
this.bottom.setStyles({opacity: '0', height: '0px', display: 'none'});
this.fx.image.hide();
this.center.className = 'lbLoading';

this.preload = new Image();
this.preload.onload = this.nextEffect.bind(this);
this.preload.src = this.images[imageNum][0];
return false;
},

nextEffect: function() {
switch(this.step++) {
case 1:
this.center.className = '';
this.image.setStyles({backgroundImage: 'url('+this.images[this.activeImage][0]+')', width: this.preload.width+'px'});
this.image.style.height = this.prevLink.style.height = this.nextLink.style.height = this.preload.height+'px';

this.caption.setHTML(this.images[this.activeImage][1] || '');
this.number.setHTML((this.images.length == 1) ? '' : 'Image '+(this.activeImage+1)+' of '+this.images.length);

if(this.activeImage != 0) this.preloadPrev.src = this.images[this.activeImage - 1][0];
if(this.activeImage != (this.images.length - 1)) this.preloadNext.src = this.images[this.activeImage + 1][0];
if(this.center.clientHeight != this.image.offsetHeight) {
this.fx.resize.custom({height: [this.center.clientHeight, this.image.offsetHeight]});
break;
}
this.step++;
case 2:
if(this.center.clientWidth != this.image.offsetWidth) {
this.fx.resize.custom({width: [this.center.clientWidth, this.image.offsetWidth], marginLeft: [-this.center.clientWidth/2, -this.image.offsetWidth/2]});
break;
}
this.step++;
case 3:
this.bottom.setStyles({top: (this.top + this.center.clientHeight)+'px', width: this.image.style.width, marginLeft: this.center.style.marginLeft, display: ''});
this.fx.image.custom(0, 1);
break;
case 4:
this.fx.bottom.custom({opacity: [0, 1], height: [0, this.bottom.scrollHeight]});
break;
case 5:
if(this.activeImage != 0) this.prevLink.style.display = '';
if(this.activeImage != (this.images.length - 1)) this.nextLink.style.display = '';
this.step = 0;
}
},

close: function() {
document.removeEvent('keydown', this.eventKeyDown);
if(this.preload) {
this.preload.onload = Class.empty;
this.preload = null;
}
for(var f in this.fx) this.fx[f].clearTimer();
this.center.style.display = this.bottom.style.display = 'none';
this.fx.overlay.set(0);
this.fixes(false);
this.step = 0;
return false;
}
};

window.addEvent('load', function(){
LightBox.init();
});


未完,待续。
honglei8485 2009-11-19
  • 打赏
  • 举报
回复
楼上关键字不是都给了吗...
lyp71887188 2009-11-19
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 amani11 的回复:]
搜吧,jquery、lightbox
[/Quote]

谢谢啦。
以什么关键字搜索呢?
amani11 2009-11-19
  • 打赏
  • 举报
回复
搜吧,jquery、lightbox

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧