Alt 12.07.2010, 18:04:39   #1 (permalink)
Apfel!
Benutzerbild von cooltek

ID: 313382
Lose-Remote

cooltek eine Nachricht über ICQ schicken cooltek eine Nachricht über Skype™ schicken
Reg: 17.03.2008
Beiträge: 1.239
cooltek ist ein wunderbarer Anblickcooltek ist ein wunderbarer Anblickcooltek ist ein wunderbarer Anblickcooltek ist ein wunderbarer Anblickcooltek ist ein wunderbarer Anblickcooltek ist ein wunderbarer Anblick
Standard Von Bild 1 bis Bild 2

Hallo,

ich bins mal wieder

Ich habe mir die Javascript gellerie von bretteleben runtergeladen.

In der be_slide.js wo ich alles einstellen kann stoße ich auf ein kleines problemchen.

Bei

var def_imges=new Array ('pics/pic01.jpg', 'pics/pic02.jpg');

kann ich die Bilder auswählen die angezeigt werden sollen.
Um nicht jedes einzelne Bild eintragen zu wollen

( var def_imges=new Array ('pics/pic01.jpg', 'pics/pic02.jpg', 'pics/pic03.jpg'); )

habe ich mir gedacht auszuwählen von Bild 1 - bis Bild 44.

Ist dies möglich? Wenn Ja wie? oder nur einen ordner auswählen wo indem alle bilder die gespeichert sind abgespielt werden...




Hier mal die komplete bw_slide.js
Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
/**************************************************************** "bretteleben.de JavaScript Slideshow" - Version 20100412 License: http://www.gnu.org/copyleft/gpl.html Author: Andreas Berger Copyright (c) 2010 Andreas Berger - andreas_berger@bretteleben.de Project page and Demo at http://www.bretteleben.de Last update: 2010-04-12 *****************************************************************/ //*****parameters to set***** //into this array insert the paths of your pics. var def_imges=new Array ('pics/pic01.jpg', 'pics/pic02.jpg'); var def_divid="slideshow"; //the id of the div container that will hold the slideshow var def_picwid=800; //set this to the width of your widest pic var def_pichei=534; //... and this to the height of your highest pic var def_backgr="#000"; //set this to the background color you want to use for the slide-area //(for example the body-background-color) if your pics are of different size var def_sdur=3; //time to show a pic between fades in seconds var def_fdur=1; //duration of the complete fade in seconds var def_steps=20; //steps to fade from on pic to the next var def_startwhen="y"; //start automatically at pageload? set it to "y" for on and to "n" for off var def_shuffle="n"; //start with random image? set it to "y" for on and to "n" for off var def_showcontr="y"; //do you want to show controls? set it to "y" for on and to "n" for off //into this array insert the paths of your control-buttons or the text to display e.g. back,start,stop,fwrd. var def_contr=new Array ('bwd.png', 'start.png', 'stop.png', 'fwd.png'); //**************************************************************** //daisychain onload-events function daisychain(sl){if(window.onload) {var ld=window.onload;window.onload=function(){ld();sl();};}else{window.onload=function(){sl();};}} function be_slideshow(be_slideid,be_imges,be_divid,be_picwid,be_pichei,be_backgr,be_sdur,be_fdur,be_steps,be_startwhen,be_shuffle,be_showcontr,be_contr){ //declarations and defaults var slideid=(be_slideid)?be_slideid:"0"; var imges=(be_imges)?be_imges:def_imges; var divid=(be_divid)?be_divid:def_divid; var picwid=(be_picwid)?be_picwid:def_picwid; var pichei=(be_pichei)?be_pichei:def_pichei; var backgr=(be_backgr)?be_backgr:def_backgr; var sdur=(be_sdur)?be_sdur:def_sdur; var fdur=(be_fdur)?be_fdur:def_fdur; var steps=(be_steps)?be_steps:def_steps; var startwhen=(be_startwhen)?be_startwhen:def_startwhen; startwhen=(startwhen.toLowerCase()=="y")?1:0; var shuffle=(be_shuffle)?be_shuffle:def_shuffle; shuffle=(shuffle.toLowerCase()=="y")?1:0; var showcontr=(be_showcontr)?be_showcontr:def_showcontr; showcontr=(showcontr.toLowerCase()=="y")?1:0; var contr=(be_contr)?be_contr:def_contr; var ftim=fdur*1000/steps; var stim=sdur*1000; var emax=imges.length; var self = this; var stopit=1; var startim=1; var u=0; var parr = new Array(); var ptofade,pnext,factor,mytimeout; //check if there are at least 3 pictures, elswhere double the array if(imges.length<=2){imges=imges.concat(imges);} //shuffle images if set if(shuffle){var i;for(i=0;i<=Math.floor(Math.random()*imges.length);i++){imges.push(imges.shift());}} //push images into array and get things going this.b_myfade = function(){ var a,idakt,paktidakt,ie5exep; for(a=1;a<=emax;a++){ idakt="img_"+slideid+"_"+a;paktidakt=document.getElementById(idakt); ie5exep=new Array(paktidakt);parr=parr.concat(ie5exep); } if(startwhen){ stopit=0; mytimeout=setTimeout(function(){self.b_slide();},stim); } } //prepare current and next and trigger slide this.b_slide = function(){ clearTimeout(mytimeout); u=0; ptofade=parr[startim-1]; if(startim<emax){pnext=parr[startim];} else{pnext=parr[0];} pnext.style.zIndex=1; pnext.style.visibility="visible"; pnext.style.filter="Alpha(Opacity=100)"; try{pnext.style.removeAttribute("filter");} catch(err){} pnext.style.MozOpacity=1; pnext.style.opacity=1; ptofade.style.zIndex=2; ptofade.style.visibility="visible"; ptofade.style.filter="Alpha(Opacity=100)"; ptofade.style.MozOpacity=1; ptofade.style.opacity=1; factor=100/steps; if(stopit=="0"){ this.b_slidenow(); } } //one step forward this.b_forw = function(){ stopit=1; clearTimeout(mytimeout); ptofade=parr[startim-1]; if(startim<emax){pnext=parr[startim];startim=startim+1;} else{pnext=parr[0];startim=1;} ptofade.style.visibility="hidden"; ptofade.style.zIndex=1; pnext.style.visibility="visible"; pnext.style.zIndex=2; self.b_slide(); } //one step back this.b_back = function(){ stopit=1; clearTimeout(mytimeout); if(u==0){ //between two slides ptofade=parr[startim-1]; if(startim<emax){pnext=parr[startim];} else{pnext=parr[0];} pnext.style.visibility="hidden"; ptofade.style.zIndex=1; ptofade.style.visibility="visible"; if(startim>=2){startim=startim-1;} else{startim=emax;} self.b_slide(); } else{ //whilst sliding self.b_slide(); } } //slide as said, then give back this.b_slidenow = function(){ var check1,maxalpha,curralpha; check1=ptofade.style.MozOpacity; maxalpha=(100-factor*u)/100*105; if(check1<=maxalpha/100){u=u+1;} curralpha=100-factor*u; ptofade.style.filter="Alpha(Opacity="+curralpha+")"; ptofade.style.MozOpacity=curralpha/100; ptofade.style.opacity=curralpha/100; if(u<steps){ //slide not finished if(stopit=="0"){mytimeout=setTimeout(function(){self.b_slidenow();},ftim);} else {this.b_slide();} } else{ //slide finished if(startim<emax){ ptofade.style.visibility="hidden"; ptofade.style.zIndex=1; pnext.style.zIndex=2; startim=startim+1;u=0; mytimeout=setTimeout(function(){self.b_slide();},stim); } else{ ptofade.style.visibility="hidden"; ptofade.style.zIndex=1; pnext.style.zIndex=2; startim=1;u=0; mytimeout=setTimeout(function(){self.b_slide();},stim); } } } //manual start this.b_start= function(){ if(stopit==1){ stopit=0; mytimeout=setTimeout(function(){self.b_slide();},stim); } } //manual stop this.b_stop= function(){ clearTimeout(mytimeout); stopit=1; this.b_slide(); } //insert css and images this.b_insert= function(){ var b, thestylid, thez, thevis, slidehei; slidehei=(showcontr)?(pichei+25):(pichei); //add space for the controls var myhtml="<div style='width:"+picwid+"px;height:"+slidehei+"px;'>"; myhtml+="<div style='position:absolute;width:"+picwid+"px;height:"+pichei+"px;'>"; for(b=1;b<=emax;b++){ thez=1;thevis='hidden'; if(b<=1) {thez=2; thevis='visible';} myhtml+="<div id='img_"+slideid+"_"+b+"' style='font-size:0;line-height:"+pichei+"px;margin:0;padding:0;text-align:center;visibility:"+thevis+";z-index:"+thez+";position:absolute;left:0;top:0;width:"+picwid+"px;height:"+pichei+"px;background-color:"+backgr+";'>"; myhtml+="<img src='"+imges[(b-1)]+"' style='vertical-align:middle;border:0;' alt=''/></div>"; } myhtml+="</div>"; //show controls if(showcontr){ for(b=1;b<=4;b++){ var check=contr[b-1].substring(contr[b-1].length-3).toLowerCase(); //check for buttons contr[b-1]=(check=="jpg"||check=="gif"||check=="png")?("<img src='"+contr[b-1]+"' style='border:none;' alt=''/>"):(contr[b-1]); } myhtml+="<div style='display:block;width:"+picwid+"px;padding-top:"+(pichei+3)+"px;text-align:center;'>"; myhtml+="<a href='javascript:be_"+slideid+".b_back();' style='text-decoration:none'>"+contr[0]+"</a>&nbsp;"; myhtml+="<a href='javascript:be_"+slideid+".b_start();' style='text-decoration:none'>"+contr[1]+"</a>&nbsp;"; myhtml+="<a href='javascript:be_"+slideid+".b_stop();' style='text-decoration:none'>"+contr[2]+"</a>&nbsp;"; myhtml+="<a href='javascript:be_"+slideid+".b_forw();' style='text-decoration:none'>"+contr[3]+"</a>"; } myhtml+="</div>"; document.getElementById(divid).innerHTML=myhtml; self.b_myfade(); } //call autostart-function daisychain(this.b_insert); } var be_0= new be_slideshow();
cooltek ist offline   Mit Zitat antworten
Gesponsorte Links
Alt 12.07.2010, 18:35:33   #2 (permalink)
be forever curious
Benutzerbild von tleilax

ID: 27936
Lose-Remote

Reg: 20.04.2006
Beiträge: 2.259
tleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehentleilax genießt hohes Ansehen
Standard

Nuja, wenn's nur ums Erzeugen des Bilder-Arrays geht:
PHP-Code:
1:
2:
3:
var def_imges=new Array();
for (var 
i=1i<=44i++)
  
def_imges.push('pics/pic'+(i<10?'0'+i:i)+'.jpg'); 
.lange tage und angenehme nächte, tlx
:.whatthemovie.com (Screenshots raten) | PHP ExportForce-Klasse
tleilax ist offline   Mit Zitat antworten
Alt 21.11.2010, 07:48:25   #3 (permalink)
Neuer Benutzer

Reg: 21.11.2010
Beiträge: 1
sunnestrahl befindet sich auf einem aufstrebenden Ast
Standard Alle Bider aus einem Folder

Hallo
Vielleicht könnt Ihr mir ja weiterhelfen, ich habe da keine Ahnung aber der Versuch ist es Wert.

Wie würde denn der Code lauten, wenn alle Bilder in einem Verzeichnis ausgewählt werden?
Und ist es auch möglich die Endung (gif,png, oder jpg) als platzhalter einzutragen?
Also der Array müsste alle Bilder in einem Folder auswählen egal welches format.

Geht das auch?

Vielen Dank für Eure Hilfe
Gruss Markus
sunnestrahl ist offline   Mit Zitat antworten
Antwort

Gesponsorte Links

Anzeige


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Bitburger Sport Bild Code / 4 Wochen Sport Bild Gratis sialto Lose4Auctions 0 03.11.2009 22:17:12
rundes Bild ausschneiden und als rundes Bild speichern speedy00 Grafik & Design 10 26.02.2008 12:24:06
[Suche ein Bild für Lose Grafik oder richtiges Bild Tray Lose4Graphics 5 11.11.2007 18:34:03
(V) Grundig 81cm LCD-Fernseher HD ready Bild-im-Bild chris88 Kleinanzeigen 15 01.08.2006 12:59:45


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:09:58 Uhr.