JS弹出框thickbox.docx

上传人:b****8 文档编号:12109595 上传时间:2023-06-04 格式:DOCX 页数:57 大小:26.57KB
下载 相关 举报
JS弹出框thickbox.docx_第1页
第1页 / 共57页
JS弹出框thickbox.docx_第2页
第2页 / 共57页
JS弹出框thickbox.docx_第3页
第3页 / 共57页
JS弹出框thickbox.docx_第4页
第4页 / 共57页
JS弹出框thickbox.docx_第5页
第5页 / 共57页
JS弹出框thickbox.docx_第6页
第6页 / 共57页
JS弹出框thickbox.docx_第7页
第7页 / 共57页
JS弹出框thickbox.docx_第8页
第8页 / 共57页
JS弹出框thickbox.docx_第9页
第9页 / 共57页
JS弹出框thickbox.docx_第10页
第10页 / 共57页
JS弹出框thickbox.docx_第11页
第11页 / 共57页
JS弹出框thickbox.docx_第12页
第12页 / 共57页
JS弹出框thickbox.docx_第13页
第13页 / 共57页
JS弹出框thickbox.docx_第14页
第14页 / 共57页
JS弹出框thickbox.docx_第15页
第15页 / 共57页
JS弹出框thickbox.docx_第16页
第16页 / 共57页
JS弹出框thickbox.docx_第17页
第17页 / 共57页
JS弹出框thickbox.docx_第18页
第18页 / 共57页
JS弹出框thickbox.docx_第19页
第19页 / 共57页
JS弹出框thickbox.docx_第20页
第20页 / 共57页
亲,该文档总共57页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

JS弹出框thickbox.docx

《JS弹出框thickbox.docx》由会员分享,可在线阅读,更多相关《JS弹出框thickbox.docx(57页珍藏版)》请在冰点文库上搜索。

JS弹出框thickbox.docx

JS弹出框thickbox

/*PrototypeJavaScriptframework,version1.4.0

*(c)2005SamStephenson

*

*THISFILEISAUTOMATICALLYGENERATED.Whensendingpatches,pleasediff

*againstthesourcetree,availablefromthePrototypedarcsrepository.

*

*PrototypeisfreelydistributableunderthetermsofanMIT-stylelicense.

*

*Fordetails,seethePrototypewebsite:

*

/*--------------------------------------------------------------------------*/

varPrototype={

Version:

'1.4.0',

ScriptFragment:

'(?

:

>)((\n|\r|.)*?

)(?

:

<\/script>)',

emptyFunction:

function(){},

K:

function(x){returnx}

}

varClass={

create:

function(){

returnfunction(){

this.initialize.apply(this,arguments);

}

}

}

varAbstract=newObject();

Object.extend=function(destination,source){

for(propertyinsource){

destination[property]=source[property];

}

returndestination;

}

Object.inspect=function(object){

try{

if(object==undefined)return'undefined';

if(object==null)return'null';

returnobject.inspect?

object.inspect():

object.toString();

}catch(e){

if(einstanceofRangeError)return'...';

throwe;

}

}

Function.prototype.bind=function(){

var__method=this,args=$A(arguments),object=args.shift();

returnfunction(){

return__method.apply(object,args.concat($A(arguments)));

}

}

Function.prototype.bindAsEventListener=function(object){

var__method=this;

returnfunction(event){

return__method.call(object,event||window.event);

}

}

Object.extend(Number.prototype,{

toColorPart:

function(){

vardigits=this.toString(16);

if(this<16)return'0'+digits;

returndigits;

},

succ:

function(){

returnthis+1;

},

times:

function(iterator){

$R(0,this,true).each(iterator);

returnthis;

}

});

varTry={

these:

function(){

varreturnValue;

for(vari=0;i

varlambda=arguments[i];

try{

returnValue=lambda();

break;

}catch(e){}

}

returnreturnValue;

}

}

/*--------------------------------------------------------------------------*/

varPeriodicalExecuter=Class.create();

PeriodicalExecuter.prototype={

initialize:

function(callback,frequency){

this.callback=callback;

this.frequency=frequency;

this.currentlyExecuting=false;

this.registerCallback();

},

registerCallback:

function(){

setInterval(this.onTimerEvent.bind(this),this.frequency*1000);

},

onTimerEvent:

function(){

if(!

this.currentlyExecuting){

try{

this.currentlyExecuting=true;

this.callback();

}finally{

this.currentlyExecuting=false;

}

}

}

}

/*--------------------------------------------------------------------------*/

function$(){

varelements=newArray();

for(vari=0;i

varelement=arguments[i];

if(typeofelement=='string')

element=document.getElementById(element);

if(arguments.length==1)

returnelement;

elements.push(element);

}

returnelements;

}

Object.extend(String.prototype,{

stripTags:

function(){

returnthis.replace(/<\/?

[^>]+>/gi,'');

},

stripScripts:

function(){

returnthis.replace(newRegExp(Prototype.ScriptFragment,'img'),'');

},

extractScripts:

function(){

varmatchAll=newRegExp(Prototype.ScriptFragment,'img');

varmatchOne=newRegExp(Prototype.ScriptFragment,'im');

return(this.match(matchAll)||[]).map(function(scriptTag){

return(scriptTag.match(matchOne)||['',''])[1];

});

},

evalScripts:

function(){

returnthis.extractScripts().map(eval);

},

escapeHTML:

function(){

vardiv=document.createElement('div');

vartext=document.createTextNode(this);

div.appendChild(text);

returndiv.innerHTML;

},

unescapeHTML:

function(){

vardiv=document.createElement('div');

div.innerHTML=this.stripTags();

returndiv.childNodes[0]?

div.childNodes[0].nodeValue:

'';

},

toQueryParams:

function(){

varpairs=this.match(/^\?

?

(.*)$/)[1].split('&');

returnpairs.inject({},function(params,pairString){

varpair=pairString.split('=');

params[pair[0]]=pair[1];

returnparams;

});

},

toArray:

function(){

returnthis.split('');

},

camelize:

function(){

varoStringList=this.split('-');

if(oStringList.length==1)returnoStringList[0];

varcamelizedString=this.indexOf('-')==0

?

oStringList[0].charAt(0).toUpperCase()+oStringList[0].substring

(1)

:

oStringList[0];

for(vari=1,len=oStringList.length;i

vars=oStringList[i];

camelizedString+=s.charAt(0).toUpperCase()+s.substring

(1);

}

returncamelizedString;

},

inspect:

function(){

return"'"+this.replace('\\','\\\\').replace("'",'\\\'')+"'";

}

});

String.prototype.parseQuery=String.prototype.toQueryParams;

var$break=newObject();

var$continue=newObject();

varEnumerable={

each:

function(iterator){

varindex=0;

try{

this._each(function(value){

try{

iterator(value,index++);

}catch(e){

if(e!

=$continue)throwe;

}

});

}catch(e){

if(e!

=$break)throwe;

}

},

all:

function(iterator){

varresult=true;

this.each(function(value,index){

result=result&&!

!

(iterator||Prototype.K)(value,index);

if(!

result)throw$break;

});

returnresult;

},

any:

function(iterator){

varresult=true;

this.each(function(value,index){

if(result=!

!

(iterator||Prototype.K)(value,index))

throw$break;

});

returnresult;

},

collect:

function(iterator){

varresults=[];

this.each(function(value,index){

results.push(iterator(value,index));

});

returnresults;

},

detect:

function(iterator){

varresult;

this.each(function(value,index){

if(iterator(value,index)){

result=value;

throw$break;

}

});

returnresult;

},

findAll:

function(iterator){

varresults=[];

this.each(function(value,index){

if(iterator(value,index))

results.push(value);

});

returnresults;

},

grep:

function(pattern,iterator){

varresults=[];

this.each(function(value,index){

varstringValue=value.toString();

if(stringValue.match(pattern))

results.push((iterator||Prototype.K)(value,index));

})

returnresults;

},

include:

function(object){

varfound=false;

this.each(function(value){

if(value==object){

found=true;

throw$break;

}

});

returnfound;

},

inject:

function(memo,iterator){

this.each(function(value,index){

memo=iterator(memo,value,index);

});

returnmemo;

},

invoke:

function(method){

varargs=$A(arguments).slice

(1);

returnthis.collect(function(value){

returnvalue[method].apply(value,args);

});

},

max:

function(iterator){

varresult;

this.each(function(value,index){

value=(iterator||Prototype.K)(value,index);

if(value>=(result||value))

result=value;

});

returnresult;

},

min:

function(iterator){

varresult;

this.each(function(value,index){

value=(iterator||Prototype.K)(value,index);

if(value<=(result||value))

result=value;

});

returnresult;

},

partition:

function(iterator){

vartrues=[],falses=[];

this.each(function(value,index){

((iterator||Prototype.K)(value,index)?

trues:

falses).push(value);

});

return[trues,falses];

},

pluck:

function(property){

varresults=[];

this.each(function(value,index){

results.push(value[property]);

});

returnresults;

},

reject:

function(iterator){

varresults=[];

this.each(function(value,index){

if(!

iterator(value,index))

results.push(value);

});

returnresults;

},

sortBy:

function(iterator){

returnthis.collect(function(value,index){

return{value:

value,criteria:

iterator(value,index)};

}).sort(function(left,right){

vara=left.criteria,b=right.criteria;

returna

-1:

a>b?

1:

0;

}).pluck('value');

},

toArray:

function(){

returnthis.collect(Prototype.K);

},

zip:

function(){

variterator=Prototype.K,args=$A(arguments);

if(typeofargs.last()=='function')

iterator=args.pop();

varcollections=[this].concat(args).map($A);

returnthis.map(function(value,index){

iterator(value=collections.pluck(index));

returnvalue;

});

},

inspect:

function(){

return'#

'+this.toArray().inspect()+'>';

}

}

Object.extend(Enumerable,{

map:

Enumerable.collect,

find:

Enumerable.detect,

select:

Enumerable.findAll,

member:

Enumerable.include,

entries:

Enumerable.toArray

});

var$A=Array.from=function(iterable){

if(!

iterable)return[];

if(iterable.toArray){

returniterable.toArray();

}else{

varresults=[];

for(vari=0;i

results.push(iterable[i]);

returnresults;

}

}

Object.extend(Array.prototype,Enumerable);

Array.prototype._reverse=Array.prototype.reverse;

Object.extend(Array.prototype,{

_each:

function(iterator){

for(vari=0;i

iterator(this[i]);

},

clear:

function(){

this.length=0;

returnthis;

},

first:

function(){

returnthis[0];

},

last:

function(){

returnthis[this.length-1];

},

compact:

function(){

returnthis.select(function(value){

returnvalue!

=undefined||value!

=null;

});

},

flatten:

function(){

returnthis.inject([],function(array,value){

returnarray.concat(value.constructor==Array?

value.flatten():

[value]);

});

},

without:

function(){

varvalues=$A(arguments);

returnthis.select(function(value){

return!

values.include(value);

});

},

indexOf:

function(object){

for(vari=0;i

if(this[i]==object)returni;

return-1;

},

reverse:

function(inline){

return(inline!

==false?

thi

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2