🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #51635

Re: Slider z podpisami

#51635
From: zpksoft
Date: Thu, 31 Dec 2015 13:11
54 lines
3087 bytes
W dniu środa, 30 grudnia 2015 19:48:19 UTC+1 użytkownik Michal M. Lechanski napisał:
> Znalazłem taki slider (http://snipplr.com/view/59060/):
> 
>     <html>
>     <head>
>         <title>Sliding Images</title>
>         <script type="text/javascript">
>             //Create images Array
>             var imgArr = new Array("images/img1.jpg",
>                         "images/img2.jpg",
>                         "images/img3.jpg");
              var imgPodp = new Array("dcsdc", "ddddd", "xwxwsxwx");
> 
>             var count = imgArr.length; // assign images array length
>             var position = 0; //position is set to zero
> 
>             function slidingImages() {
>                 if ( document.images ) {
>                     if ( position < count ) {
>                         imageSrc(position); // call the image source
>                         position += 1;
>                     } else {
>                         position = 0;
>                         imageSrc(position);
>                     }
>                 }
>                 setTimeout(slidingImages, 3000);
>             }
> 
>             function imageSrc(position) {
>                 document.banner.src = imgArr[position];
                  document.getElementById('podp').innerHTML=podp[position];
>             }
>         </script>
>     </head>
>     <body onload="slidingImages()">
          <div id="podp"><div>
>         <img src="images/img1.jpg" name="banner"/>
>     </body>
>     </html>
> 
> Dla moich potrzeb jest niemal idealny - brak mu tylko możliwości
> wyświetlania podpisu pod poszczególnymi obrazkami.
> 
> Niestety nie potrafię takiej funkcji sam dodać. Pomożecie?
> Z góry bardzo dziękuję.
> 
> -- 
> The Mis'

Można oczywiście bardziej elegancko (np. jedna tablica dwuwymiarowa).
(pisałem bez testowania, może być literówka)

Paweł
Technical Details
Message-ID: <5dde37e5-6dc8-4b8a-8513-a07f076e14c2@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.glorb.com!94no2117131qgt.1!news-out.google.com!79ni461qgg.1!nntp.google.com!6no1866116qgy.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <n618th$pti$1$michal@news.chmurka.net>

Show Full Headers
Complete Article Headers
X-Received: by 10.129.103.84 with SMTP id b81mr54170804ywc.32.1451567485276;        Thu, 31 Dec 2015 05:11:25 -0800 (PST)
X-Received: by 10.140.96.111 with SMTP id j102mr831837qge.14.1451567485233; Thu, 31 Dec 2015 05:11:25 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.glorb.com!94no2117131qgt.1!news-out.google.com!79ni461qgg.1!nntp.google.com!6no1866116qgy.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.javascript
Date: Thu, 31 Dec 2015 05:11:24 -0800 (PST)
In-Reply-To: <n618th$pti$1$michal@news.chmurka.net>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.22.233.203; posting-account=8ND_mgoAAAD5J9y9fnaTB1Kcu7xKWk7Q
NNTP-Posting-Host: 83.22.233.203
References: <n618th$pti$1$michal@news.chmurka.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5dde37e5-6dc8-4b8a-8513-a07f076e14c2@googlegroups.com>
Subject: Re: Slider z podpisami
From: zpksoft <zpksoft@op.pl>
Injection-Date: Thu, 31 Dec 2015 13:11:25 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit