Реклама на сайте Advertise with us

Зубрам ява-скрипта вопрос

Расширенный поиск по форуму
 
Новая тема Новая тема   
Автор
Поиск в теме:



С нами с 06.06.05
Сообщения: 604
Рейтинг: 306

Ссылка на сообщениеДобавлено: 28/07/07 в 12:10       Ответить с цитатойцитата 

Чё за скрипт такой? ЧЁ он делает?
Замучался читать от не опытности.

Цитата:

var ie = (navigator.appname=="microsoft internet explorer"); function submitform() { for(x=0;x<form_items.length;x++) { var item = new object(); if(ie) item = document.forms['form' + form_items[x]].elements[0]; else { var itemform = document.layers[form_items[x]].document.forms; if(itemform.length == 0) itemform = document.layers[form_items[x]].document.layers[form_items[x]+'m'].document.layers[form_ite
ms[x]+'m'].document.forms; item = itemform[0].elements[0]; } if(item.type == "text" || item.type == "textarea") { document.forms['finalform'].elements[item.name].value = item.value; if(ie && item.getattribute("required") != null && item.value.length == 0) { alert(form_message); return false; } } else if(item.type == "select-one" && item.selectedindex!=-1) document.forms['finalform'].elements[item.name].value = item.options[item.selectedindex].value; else if(item.type == "select-multiple") { var selopts = ''; for(var i=0;i<item.options.length;i++) { if(item.options[i].selected==true) selo
pts += item.options[i].value + "; "; } document.forms['finalform'].elements[item.name].value = selopts; } else if(item.type == "checkbox") document.forms['finalform'].elements[item.name].value = item.checked?item.value:''; else if(item.type == "radio" && item.checked) document.forms['finalform'].elements[item.name].value = item.value; } document.forms['finalform'].submit(); return true; } function leaveothers(fn,nm) { for(x=0;x<form_items.length;x++) { if(fn != 'form' + form_items[x]) { var item = new object(); if(ie) item = document.forms['form' + form_items[x]].elements[0]; else item = document.layers[form_items[x]].document.layers[form_items[x]+'m'].document.layers[form_ite
ms[x]+'m'].document.forms[0].elements[0]; if(item.type == "radio" && item.name == nm) item.checked = false; } } } function checkvalues(message) { for(var x=0;x<document.forms[0].elements.length;x++) { if(ie && document.forms[0].elements[x].getattribute("required") != null && document.forms[0].elements[x].value.length == 0) { alert(message); return false; } } return true; } function reset_form() { for(x=0;x<form_items.length;x++) { var item = new object(); if(ie) item = document.forms['form' + form_items[x]]; else { var itemform = document.layers[form_items[x]].document.forms; if(itemform.length == 0) itemform = document.layers[form_items[x]].document.layers[form_items[x]+'m'].document.layers[form_ite
ms[x]+'m'].document.forms; item = itemform[0].elements[0]; } item.reset(); } } function transitions_netscape() { for(var x=0;x<slides[0].elems.length;x++) { id = slides[0].elems[x].id; document[id].width = document[id].clip.width; document[id].height = document[id].clip.height; filter = slides[0].elems[x].filter.tolowercase(); var starttrans = filter.indexof("transition="); if(start!=-1) { var endtrans = filter.indexof(")",starttrans); document[slides[0].elems[x].id].transition = filter.substring(starttrans+11,endtrans); starttrans = filter.indexof("duration="); endtrans = filter.indexof(",",starttrans); document[slides[0].elems[x].id].duration = filter.substring(starttrans+9,endtrans); } document[id].aantal = parseint((document[id].duration*1000)/100); document[id].incrx = document[id].width / document[id].aantal; document[id].incry = document[id].height / document[id].aantal; document[id].count = 0; document[id].status = 0; document[id].finishnn = finishnn; if(parseint(document[id].transition)==23) document[id].transition = parseint(math.random()*22); else if(parseint(document[id].transition)>23 || parseint(document[id].transition)<0) document[id].transition = parseint(math.random()*22); document[id].play_transition = catcherror; if(document[id].visibility=='hide') { switch(parseint(document[i
d].transition)) { case 0: case 1: case 2: case 3: case 12: document[id].clip.left = parseint(document[id].width/2); document[id].clip.right = parseint(document[id].width/2); document[id].clip.top = parseint(document[id].height/2); document[id].clip.bottom = parseint(document[id].height/2); document[id].play_transition = transition_boxout; break; case 4: document[id].clip.left = 0; document[id].clip.right = parseint(document[id].width); document[id].clip.top = parseint(document[id].height); document[id].clip.bottom = 0; document[id].play_transition = transition_wipeup; break; case 5: case 11: document[id].clip.left = 0; document[id].clip.right = parseint(document[id].width); document[id].clip.top = 0; document[id].clip.bottom = 0; document[id].play_transition = transition_wipedown; break; case 6: document[id].clip.left = 0; document[id].clip.right = 0; document[id].clip.top = 0; document[id].clip.bottom = parseint(document[id].height); document[id].play_transition = transition_wiperight; break; case 7: document[id].clip.left = parseint(document[id].width); document[id].clip.right = 0; document[id].clip.top = 0; document[id].clip.bottom = parseint(document[id].height); document[id].play_transition = transition_wipeleft; break; case 8: case 13: case 14: case 22: document[id].clip.left = parseint(document[id].width/2); document[id].clip.right = parseint(document[id].width/2); document[id].clip.top = 0; document[id].clip.bottom = parseint(document[id].height); document[id].play_transition = transition_verticalout; break; case 9: case 15: case 16: case 21: document[id].clip.left = 0; document[id].clip.right = parseint(document[id].width); document[id].clip.top = parseint(document[id].height/2); document[id].clip.bottom = parseint(document[id].height/2); document[id].play_transition = transition_horizontalout; break; case 17: document[id].clip.left = 0; document[id].clip.right = 0; document[id].clip.top = 0; document[id].clip.bottom = 0; document[id].play_transition = transition_leftdown; break; case 18: document[id].clip.left = 0; document[id].clip.right = 0; document[id].clip.top = parseint(document[id].height); document[id].clip.bottom = 0; document[id].play_transition = transition_leftup; break; case 10: case 19: document[id].clip.left = parseint(document[id].width); document[id].clip.right = parseint(document[id].width); document[id].clip.top = 0; document[id].clip.bottom = 0; document[id].play_transition = transition_rightdown; break; case 20: document[id].clip.left = parseint(document[id].width); document[id].clip.right = parseint(document[id].width); document[id].clip.top = parseint(document[id].height); document[id].clip.bottom = 0; document[id].play_transition = transition_rightup; break; } } } } function startwaves() { if(ie) { for(var x=0;x<waveselements.length;x++) { document.all(waveselements[x]).wave(); }
} } var currentslide = 0; var oldslide = null; var elementname; var currentelement; var x=0; function start() { if(x<slides[currentslide].elems.length) { currentelement = slides[currentslide].elems[x]; if(ie) { elementname = document.all(slides[currentslide].elems[x++].id); wait = parseint(elementname.filters(0).duration * 1000); } else { elementname = document[slides[currentslide].elems[x].id]; wait = parseint(document[slides[currentslide].elems[x].id].duration*1000); x++; } sh
ow(wait); } } function gotoslide(sl) { window.event.cancelbubble = true; oldslide = currentslide; currentslide = sl; settimeout('slidestart()',1); } function show(wait) { if(ie) { elementname.filters(0).stop(); elementname.filters(0).app
ly(); elementname.style.visibility = ''; elementname.filters(0).play(); } else { elementname.visibility = 'visible'; elementname.status = 1; elementname.play_transition(); } while(currentelement.next == "direct") { if(x<slides[currentslide].elems.length) { currentelem
ent = slides[currentslide].elems[x]; if(ie) { elementname = document.all(slides[currentslide].elems[(x++)].id); wait = parseint(elementname.filters(0).duration * 1000); elementname.filters(0).apply(); elementname.style.visibility = ''; elementname.filters(0).play(); } else { elementname = document[slides[currentslide].elems[(x++)].id]; elementname.visibility = 'visible'; elementname.status = 1; elementname.play_transition(); } } else { break; } }
if(currentelement.next == "timer") { settimeout('start()', wait + (parseint(currentelement.wait*1000))); } else if(currentelement.next == "direct") { settimeout('start()', wait); } } function document_onclick() { if(currentelement != null) { if(ie) { if(document.all(currentelement.id).filters(0).stat us==0 && currentelement.next == "mouseclick") { start(); } } else { if(document[curren
telement.id].status == 2 && currentelement.next == "mouseclick") { start(); } } } } function playsound(id) { sobj = 'document.' + id; sdo = 'run()'; if(!ie) { if(sdo.indexof('run')!=-1) eval(sobj+ '.play(false)'); else eval(sobj+'.'+sdo); } else { if(eval(sobj+".
filename")) { eval(sobj+ '.stop()'); eval(sobj+ '.play()'); } } } function transition_boxout() { if(this.clip.left>0) { this.clip.left = parseint((this.width / 2) - (getround(this,0)/2)); this.clip.right = parseint((this.width / 2) + (getround(this,0)/2)); this.clip.top = parseint((this.height / 2) - (getround(this,1)/2)); this.clip.bottom = parseint((this.height / 2) + (getround(this,1)/2)); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_wipeup() { if(this.clip.top>0) { this.clip.top = parseint(this.height - getround(this,1)); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_wipedown() { if(this.clip.bottom<parseint(this.height)) { this.clip.
bottom = getround(this,1); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_wiperight() { if(this.clip.right<parseint(this.width)) { this.clip.r
ight = getround(this,0); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_wipeleft() { if(this.clip.left>0) { this.clip.left = parseint(this.width - getround(this,0)); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_verticalout() { if(this.clip.left>0) { this.clip.left = parseint((this.width/2) - (getround(this,0)/2)); this.clip.right = parseint((this.width/2) + (getround(this,0)/2)); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_horizontalout() { if(this.clip.top>0) { this.clip.top = parseint((this.height/2) - (getround(this,1)/2)); this.clip.bottom = parseint((this.height/2) + (getround(this,1)/2)); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_leftdown() { if(this.clip.right<this.width) { this.clip.right = getround(this,0); this.clip.bottom = getround(this,1); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_leftup() { if(this.clip.top>0) { this.clip.right = getround(this,0); this.clip.top = parseint(this.height - getround(this,1)); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_rightdown() { if(this.clip.left>0) { this.clip.left = parseint(this.width - getround(this,0)); this.clip.bottom = getround(this,1); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function transition_rightup() { if(this.clip.top>0) { this.clip.left = parseint(this.width - getround(this,0)); this.clip.top = parseint(this.height - getround(this,1)); this.count++; settimeout("document['" + this.name + "'].play_transition()",100); } else this.finishnn(); } function getround(id,type) { if(type==0) return math.round(id.count * id.incrx); else return math.round(id.count * id.incry); } function finishnn() { this.clip.left = 0; this.clip.right = this.width; this.clip.top = 0; this.clip.bottom = this.height; this.status = 2; } // marquee.js v1.3 25-4-99 17:03 var up = 1; var down = 2; var left = 4; var right = 8; var scroll = 1; var slide = 2; var alternate = 4; function marqueeobject(dir, pr, ch, tm, ds, sc, lp, dl, s, t) { this.dir = dir; this.pr = ie?document.all(pr):document.layers[pr]; this.ml = ie?document.all(ch):this.pr.document.layers[ch]; this.dx = 0; this.dy = 0; this.mlw = ie?this.pr.clientwidth:this.pr.clip.width; this.mlh = ie?this.pr.clientheight:this.pr.clip.height; this.ln = ch; this.tm = tm; this.dl = dl; this.sc = sc; this.lp = lp; this.lpc = 0; this.px = 0; this.py = 0; this.s = s; this.resetmarq = resetmarq; this.movemarq = movemarq; this.setclip = setclip; this.changeclip = changeclip; this.moveabs = moveabs; this.moverel = moverel; if(dir&up) { this.dy = -ds; } else if(dir&down) { this.dy = ds; } var ratio = this.mlh / this.mlw; if(dir&left) { this.dx = -ds; if(dir&(up|down)) { this.dy *= ratio; } } else if(dir&right) { this.dx = ds; if(dir&(up|down)) { this.dy *= ratio; } } this.setclip(0, this.dx!=0?0:this.mlw, this.dy!=0?0:this.mlh, 0); if(ie && t!=1) this.pr.style.visibility = ''; else this.pr.visibility = 'visible'; } function setclip(a, b, c, d) { this.ct = a; this.cw = b; this.ch = c; this.cl = d; if(ie) this.ml.style.clip = "rect(" + a + " " + b + " " + c + " " + d + ")"; else { this.ml.clip.top = a; this.ml.clip.right = b; this.ml.clip.bottom = c; this.ml.clip.left = d; } } function changeclip(a, b, c, d) { this.ct += a; this.cw += b; this.ch += c; this.cl += d; this.setclip(this.ct, this.cw, this.ch, this.cl); } function moveabs(x, y) { this.px = x; this.py = y; if(ie) { this.ml.style.left = x; this.ml.style.top = y; } else this.ml.moveto(x, y); } function moverel(x, y) { this.px += x; this.py += y; if(ie) { this.ml.style.left = this.px; this.ml.style.top = this.py; } else this.ml.moveto(this.px, this.py); } function resetmarq() { this.setclip(0, this.dx!=0?0:this.mlw, this.dy!=0?0:this.mlh, 0); this.moveabs(0, 0); if(this.dir&left) { this.moverel(this.mlw, 0); } else if(this.dir&right) { this.moverel(-this.mlw, 0); this.changeclip(0, this.mlw, 0, this.mlw); } if(this.dir&up) { this.moverel(0, this.mlh); } else if(this.dir&down) { this.moverel(0, -this.mlh); this.changeclip(this.mlh, 0, this.mlh, 0); } if(this.lp==0 || (this.lp>0 && this.lpc<this.lp-1)) { if(this.lpc>0 && this.sc==alternate && this.s!="") playsound(this.s); this.lpc++; settimeout("marquees.&
quot; + this.ln + ".movemarq()", this.dl); } else if(this.lpc<this.lp) { this.lpc++; this.sc = slide; settimeout("marquees." + this.ln + ".movemarq()", this.dl); } else { if(this.s!="") playsound(this.s); this.moveab
s(0, 0); this.setclip(0, this.mlw, this.mlh, 0); } } function movemarq() { var r = false, b1 = false, b2 = false; if(this.dir&left) { b1 = (this.px <= -this.mlw); b2 = (this.px <= 0); } else if(this.dir&right) { b1 = (this.px >= this.mlw); b2 = (this.px >= 0); } if(this.dir&up) { b1 |= (this.py <= -this.mlh); b2 |= (this.py <= 0); } else if(this.dir&down) { b1 |= (this.py >= this.mlh); b2 |= (this.py >= 0); } if(b1) { if(this.sc&alternate) { this.dx = -this.dx; this.dy = -this.dy; this.dir += this.dir&left?right-left:this.dir&right?left-right:0; this.dir += this.dir&up?down-up:this.dir&down?up-down:0; } r = true; } else if(b2) { if(this.sc&slide) r = true; else { if(this.dir&left) this.changeclip(0, 0, 0, -this.dx); else if(this.dir&right) this.changeclip(0, -this.dx, 0, 0); if(this.dir&down) this.changeclip(0, 0, -this.dy, 0); else if(this.dir&up) this.changeclip(-this.dy, 0, 0, 0); } } else { if(this.dir&left) this.changeclip(0, -this.dx, 0, 0); else if(this.dir&right) this.changeclip(0, 0, 0, -this.dx); if(this.dir&down) this.changeclip(-this.dy, 0, 0, 0); else if(this.dir&up) this.changeclip(0, 0, -this.dy, 0); } if(!r) { this.moverel(this.dx, this.dy); settimeout("marquees." + this.ln + ".movemarq()", this.tm); } else settimeout("marquees." + this.ln + ".resetmarq()", this.tm); } document.onclick = document_onclick;

0
 



С нами с 03.07.07
Сообщения: 481
Рейтинг: 862

Ссылка на сообщениеДобавлено: 28/07/07 в 23:45       Ответить с цитатойцитата 

Politryk писал:
Чё за скрипт такой? ЧЁ он делает?
Замучался читать от не опытности.

общий ответ - работа с мультимедиа, меню и проч - что угодно. более точно можно будет сказать когда parazweefclub.nl поднимется

python, php, js

0
 
Новая тема Новая тема   

Текстовая реклама в форме ответа
Заголовок и до четырех строчек текста
Длина текста до 350 символов
Купить рекламу в этом месте!


Перейти:  



Спонсор раздела Стань спонсором этого раздела!

Реклама на сайте Advertise with us

Опросы

Рецепт новогоднего блюда 2022



Обсудите на форуме обсудить (11)
все опросы »