Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP][HTML]Skrypt SlideShow
Forum PHP.pl > Forum > Przedszkole
TymcioPaluch
Witam,

Postanowiłem zrobić na swojej stronie skrypt pokazu slajdów.

Oto dwa pliki wykorzystywanego przez niego:


PushButtonSlideShow.html

  1.  
  2.  
  3. <title>PushButton SlideShow</title>
  4.  
  5. <!--
  6. Set up the caption font in the following style.
  7. Also set the styles for the controls.
  8. Place the style script in the head of the page.
  9. //-->
  10.  
  11. .Caption {
  12. font-family: Arial;
  13. font-weight: normal;
  14. font-size: 12pt;
  15. color: #FF3300; }
  16.  
  17. A.Controls:link { color:#666666;
  18. text-decoration:none;
  19. font-family: Arial;
  20. font-size: 14pt;
  21. font-weight: bold; }
  22. A.Controls:visited { color:#666666; text-decoration:none;
  23. font-family: Arial;
  24. font-size: 14pt;
  25. font-weight: bold; }
  26. A.Controls:active { color:#666666; text-decoration:none;
  27. font-family: Arial;
  28. font-size: 14pt;
  29. font-weight: bold; }
  30. A.Controls:hover { color:#00FF00; text-decoration:none;
  31. font-family: Arial;
  32. font-size: 14pt;
  33. font-weight: bold; }
  34.  
  35.  
  36. <!--
  37. Place the following script in the head of the page.
  38. Follow the set-up instructions within the script.
  39. //-->
  40.  
  41.  
  42. // (C) 2003 by CodeLifter.com
  43. // Free for all users, but leave in this header.
  44.  
  45. // ==============================
  46. // Set the following variables...
  47. // ==============================
  48.  
  49. // Set the slideshow speed (in milliseconds)
  50. var SlideShowSpeed = 300;
  51.  
  52. // Set the duration of crossfade (in seconds)
  53. var CrossFadeDuration = 2;
  54.  
  55. var picture = new Array(); // don't change this
  56. var Caption = new Array(); // don't change this
  57. var showHot = false; // don't change this
  58.  
  59. // Specify the image files...
  60. // To add more images, just continue
  61. // the pattern, adding to the array below.
  62. // To use fewer images, remove lines
  63. // starting at the end of the picture array.
  64. // Caution: The number of pictures *must*
  65. // equal the number of Captions!
  66.  
  67. picture[1] = 'tablica.jpg'
  68. picture[2] = 'tablica.jpg';
  69. picture[3] = 'tablica.jpg';
  70. picture[4] = 'tablica.jpg';
  71. picture[5] = 'tablica.jpg';
  72. picture[6] = 'tablica.jpg';
  73. picture[7] = 'tablica.jpg';
  74. picture[8] = 'tablica.jpg';
  75. picture[9] = 'tablica.jpg';
  76. picture[10] = 'tablica.jpg';
  77.  
  78. // Specify the Captions...
  79. // To add more captions, just continue
  80. // the pattern, adding to the array below.
  81. // To use fewer captions, remove lines
  82. // starting at the end of the Caption array.
  83. // Caution: The number of Captions *must*
  84. // equal the number of pictures!
  85.  
  86. Caption[1] = "Artykuł";
  87. Caption[2] = "Sport";
  88. Caption[3] = "Muzyka";
  89. Caption[4] = "Fotografia";
  90. Caption[5] = "Taniec";
  91. Caption[6] = "Inne";
  92. Caption[7] = "This is the seventh caption.";
  93. Caption[8] = "This is the eighth caption.";
  94. Caption[9] = "This is the ninth caption.";
  95. Caption[10] = "This is the tenth caption.";
  96.  
  97. // =====================================
  98. // Do not edit anything below this line!
  99. // =====================================
  100.  
  101. var tss;
  102. var iss;
  103. var jss = 0;
  104. var pss = picture.length-1;
  105.  
  106. var preLoad = new Array();
  107. for (iss = 1; iss < pss+1; iss++){
  108. preLoad[iss] = new Image();
  109. preLoad[iss].src = picture[iss];}
  110.  
  111. function control(how){
  112. if (showHot){
  113. if (how=="H") jss = 1;
  114. if (how=="F") jss = jss + 1;
  115. if (how=="B") jss = jss - 1;
  116. if (jss > (pss)) jss=1;
  117. if (jss < 1) jss = pss;
  118. if (document.all){
  119. document.images.pictureBox.style.filter="blendTrans(duration=2)";
  120. document.images.pictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
  121. document.images.pictureBox.filters.blendTrans.Apply();}
  122. document.images.pictureBox.src = preLoad[jss].src;
  123. if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
  124. if (document.all) document.images.pictureBox.filters.blendTrans.Play();
  125. }}
  126.  
  127.  
  128. </head>
  129.  
  130. <!--
  131. Add onload='showHot=true;' to the body tag. This is
  132. needed to prevent false object calls while the page
  133. is loading. Optional: If you are using this in a
  134. popup, as in this demo, adding self.focus() to the
  135. onload event in the body tag will bring the popup
  136. to the front each time it is loaded [recommended].
  137. //-->
  138.  
  139. <body onload='showHot=true;self.focus();' bgcolor=#000000 link="#FF0000" vlink="#FF0000" alink="#FF0000">
  140.  
  141. <!--
  142. The following table holds the images, captions, and controls.
  143. Place the table in your page where you want the slideshow
  144. to appear. Follow the instructions for each table cell.
  145. //-->
  146.  
  147. <div align="center">
  148.  
  149. <table border=0 cellpadding=10 cellspacing=0>
  150. <tr>
  151. <!--
  152. The next table cell holds the images.
  153. Set cell and image width and height the same.
  154. The img src must have name=pictureBox in its
  155. tag. Often, the first image in the picture
  156. array in the script is used here; but you
  157. may also use a different, introductory image
  158. as we have here, since this image is shown
  159. only on start-up.
  160. //-->
  161. <td width=600 height=600 colspan="3">
  162. <img src=tablica.jpg name=pictureBox width=600 height=600>
  163.  
  164. </td>
  165. </tr>
  166. <tr>
  167. <!--
  168. The next table cell holds the captions.
  169. This table cell must have id=CaptionBox and
  170. class=Caption in its tag. The default caption
  171. shows whilst loading in all browsers; NS4
  172. will show only the default caption, throughout.
  173. //-->
  174. <td id=CaptionBox class=Caption align=center colspan="3">
  175. This is the default caption.
  176. </td>
  177. </tr>
  178. <!--
  179. The following three cells contain the controls.
  180. Each of the control a href's must contain class=
  181. Controls, to attach the styles (see top of script).
  182. To dress this up a bit, you can of course substitute
  183. <img src> images for the text in the links.
  184. //-->
  185. <tr>
  186. <td align="center">
  187. <a class=Controls href="#" onClick="java script:control('B');">< <</a>
  188. </td>
  189. <td align="center">
  190. <a class=Controls href="#" onClick="java script:control('H');">| | |</a>
  191. </td>
  192. <td align="center">
  193. <a class=Controls href="#" onClick="java script:control('F');"><b>> ></b></a>
  194. </td>
  195. </tr>
  196.  
  197. </center>
  198. </div>
  199.  
  200. </body>
  201.  
  202. </html>





launch.html

  1. <title>PushButton SlideShow</title>
  2.  
  3. var launchSlideShowX = (video.width/2)-500;
  4. var launchSlideShowY = (video.height/2)-800;
  5. var pos = "left="+launchSlideShowX+",top="+launchSlideShowY;
  6. function launchSlideShow(){
  7. launchSlideShowWindow = window.open("PushButtonSlideShow.html","SlideShow","width=500,height=800,"+pos);}
  8.  
  9. </head>
  10.  
  11. <body bgcolor="#000000" link="#FF8040" vlink="#FF8040" alink="#FF8040">
  12. <div align="center">
  13. <table border="0" cellpadding="5" cellspacing="0" width="100%" height="80%">
  14. <tr>
  15. <td width="100%" height="80%" valign="middle" align="center"><a href="java script:launchSlideShow()"><font size="5">Launch<br>SlideShow</font></a></td>
  16. </tr>
  17. </table>
  18. </center>
  19. </div>
  20.  
  21. </body>
  22.  
  23. </html>
  24.  
  25.  


I teraz pojawia się problem otóż standardowo skrypt ten jest stworzony do wyświetlania obrazków. Ja natomiast chciałbym, aby była możliwość umieszczenia filmiku z youtobe w nim, oraz ustawienie jakiegoś tła.

Pomyślałem, aby zmienić w komórce poprostu tło ( wtedy będzie jedno tło dla wszystkich slajdów ) oraz podać link do pliku z youtobe zmniejszając jego rozmiar. Jednak skrypt ten nie chce odczytać tego filmiku. Bardzo proszę o pomoc. W celu pokazania jak działa skrypt daje odnośnik do mojej test domeny: Strona testowa skryptu
b4rt3kk
Znajdź sobie lepszy skrypt do pokazu slajdów, bo ten jest bardzo ubogi i przystosowany jedynie do umieszczania obrazków. Szybciej by było nawet napisać własny (przy pomocy jQuery) i na DIV-ach, w których możesz sobie umieszczać co tylko dusza zapragnie, filmik, obrazek, tekst, itd.
TymcioPaluch
Wydaje mi się że ten skrypt nie będzie tak ciężko zmienić. Tło sobie ustawie w komórce natomiast większy problem stanowi dla mnie jak uwzględnić, aby w linijce zdjecia[x]= ..... istniała możliwość załączenia filmu z youtobe.


Dodałem teraz inny skrypt dostepny pod adresem : http://zurb.com/playground/jquery_image_slider_plugin. Skrypt jest na bibliotekach jquery.
I również pojawia się problem z wrzuceniem filmiku ( skrypt na divach): http://www.keytogames.hekko.pl/kontakt.html

Nie wiem jak to ugryźć :/
mlawnik
Użyj gotowego lightboxa czy innego -boxa, w nich filmiki na pewno działają.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.