Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Slider
Outside
post
Post #1





Grupa: Zarejestrowani
Postów: 63
Pomógł: 1
Dołączył: 28.08.2013

Ostrzeżenie: (0%)
-----


Od dwóch dni szukam rozwiązania w internecie, próbuje przerabiać różne skrypty i nic z tego, a mianowicie mam sobie stronkę
http://ezeszyt.ugu.pl/str i jest tam ranking i terminarz, chciałbym aby to było przesuwane, posiada ktoś może gotowy taki slider, ktory będzie po prostu przesuwał tamto po wcisnieciu strzzałek na bokach?
Na googlach dwa dni przeszukane i poznajdywałem tylko gotowe rozwiązania, które obsługują tylko zdjęcia, a jak wrzucam tam tekst to jest pełno problemów ze stroną..
Go to the top of the page
+Quote Post
phpion
post
Post #2





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




Chociażby to:
http://jquerytools.org/demos/scrollable/index.html
Korzystam, fajny plugin.
Go to the top of the page
+Quote Post
Outside
post
Post #3





Grupa: Zarejestrowani
Postów: 63
Pomógł: 1
Dołączył: 28.08.2013

Ostrzeżenie: (0%)
-----


Da rady to przerobic aby uzyc wlasne strzalki do przewijania i gdzie wrzucic ten kod javascript? Miedzy znacznikami <script> </script> w <head> tak?

Jest ktoś w stanie mi pomóc?(IMG:style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
com
post
Post #4





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


wystarczy zajrzeć do źródła strony (IMG:style_emoticons/default/wink.gif) http://jquerytools.org/media/css/scrollable-buttons.css odpowiada za ostylowanie strzałek, żeby tego użyć po pierwsze musisz mieć jQuery a
[JAVASCRIPT] pobierz, plaintext
  1. $(function() {
  2. // initialize scrollable
  3. $(".scrollable").scrollable();
  4. });
[JAVASCRIPT] pobierz, plaintext


Miedzy znacznikami <script> </script> tak jak powiedziałeś nie koniecznie w head ale możesz (IMG:style_emoticons/default/wink.gif)

Na marginesie popraw sobie kodowanie na stronie (IMG:style_emoticons/default/wink.gif) a & wstawiaj za pomocą znacznika &amp; (IMG:style_emoticons/default/wink.gif)
Go to the top of the page
+Quote Post
Outside
post
Post #5





Grupa: Zarejestrowani
Postów: 63
Pomógł: 1
Dołączył: 28.08.2013

Ostrzeżenie: (0%)
-----


Wszystko wstawiłem jak trzeba, kod jest poniżej, a mimo to nie działa.
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/DTD/strict.dtd">
  3. <title>Polish Summer League</title>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  5. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  6.  
  7. <script type="text/javascript">
  8. $(function() {
  9. // initialize scrollable
  10. $(".scrollable").scrollable();
  11. });
  12.  
  13.  
  14. <style type="text/css">
  15. /*
  16. root element for the scrollable. when scrolling occurs this
  17. element stays still.
  18. */
  19. .scrollable {
  20. /* required settings */
  21. position:relative;
  22. overflow:hidden;
  23. width: 660px;
  24. height:90px;
  25. }
  26.  
  27. /*
  28. root element for scrollable items. Must be absolutely positioned
  29. and it should have a extremely large width to accommodate scrollable
  30. items. it's enough that you set width and height for the root element
  31. and not for this element.
  32. */
  33. .scrollable .items {
  34. /* this cannot be too large */
  35. width:20000em;
  36. position:absolute;
  37. }
  38.  
  39. /*
  40. a single item. must be floated in horizontal scrolling. typically,
  41. this element is the one that *you* will style the most.
  42. */
  43. .items div {
  44. float:left;
  45. }
  46.  
  47. /* this makes it possible to add next button beside scrollable */
  48. .scrollable {
  49. float:left;
  50. }
  51.  
  52. /* prev, next, prevPage and nextPage buttons */
  53. a.browse {
  54. background:url(left-mini.png) no-repeat;
  55. display:block;
  56. width:30px;
  57. height:30px;
  58. float:left;
  59. margin:40px 10px;
  60. cursor:pointer;
  61. font-size:1px;
  62. }
  63.  
  64. /* right */
  65. a.right { background-position: 0 -30px; clear:right; margin-right: 0px;}
  66. a.right:hover { background-position:-30px -30px; }
  67. a.right:active { background-position:-60px -30px; }
  68.  
  69. /* left */
  70. a.left { margin-left: 0px; }
  71. a.left:hover { background-position:-30px 0; }
  72. a.left:active { background-position:-60px 0; }
  73.  
  74. /* up and down */
  75. a.up, a.down {
  76. float: none;
  77. margin: 10px 50px;
  78. }
  79.  
  80. /* up */
  81. a.up:hover { background-position:-30px 0; }
  82. a.up:active { background-position:-60px 0; }
  83.  
  84. /* down */
  85. a.down { background-position: 0 -30px; }
  86. a.down:hover { background-position:-30px -30px; }
  87. a.down:active { background-position:-60px -30px; }
  88.  
  89.  
  90. /* disabled navigational button */
  91. a.disabled {
  92. visibility:hidden !important;
  93. }
  94. /*
  95. root element for the scrollable.
  96. when scrolling occurs this element stays still.
  97. */
  98. .scrollable {
  99.  
  100. /* required settings */
  101. position:relative;
  102. overflow:hidden;
  103. width: 550px;
  104. height:120px;
  105.  
  106. /* custom decorations */
  107. border:1px solid #ccc;
  108. background:url(/media/img/gradient/h300.png) repeat-x;
  109. }
  110.  
  111. /*
  112. root element for scrollable items. Must be absolutely positioned
  113. and it should have a extremely large width to accomodate scrollable
  114. items. it's enough that you set the width and height for the root
  115. element and not for this element.
  116. */
  117. .scrollable .items {
  118. /* this cannot be too large */
  119. width:20000em;
  120. position:absolute;
  121. clear:both;
  122. }
  123.  
  124. .items div {
  125. float:left;
  126. width:680px;
  127. }
  128.  
  129. /* single scrollable item */
  130. .scrollable img {
  131. float:left;
  132. margin:20px 5px 20px 21px;
  133. background-color:#fff;
  134. padding:2px;
  135. border:1px solid #ccc;
  136. width:100px;
  137. height:75px;
  138.  
  139. -moz-border-radius:4px;
  140. -webkit-border-radius:4px;
  141. }
  142.  
  143. /* active item */
  144. .scrollable .active {
  145. border:2px solid #000;
  146. position:relative;
  147. cursor:default;
  148. }
  149.  
  150. </head>
  151.  
  152. <div style="margin:0 auto; width: 634px; height:120px;">
  153. <!-- "previous page" action -->
  154. <a class="prev browse left"></a>
  155.  
  156. <!-- root element for scrollable -->
  157. <div class="scrollable" id="scrollable">
  158.  
  159. <!-- root element for the items -->
  160. <div class="items">
  161.  
  162. <!-- 1-5 -->
  163. <div>
  164. <img src="http://farm1.static.flickr.com/143/321464099_a7cfcb95cf_t.jpg" />
  165. <img src="http://farm4.static.flickr.com/3089/2796719087_c3ee89a730_t.jpg" />
  166. <img src="http://farm1.static.flickr.com/79/244441862_08ec9b6b49_t.jpg" />
  167. <img src="http://farm1.static.flickr.com/28/66523124_b468cf4978_t.jpg" />
  168. </div>
  169.  
  170. <!-- 5-10 -->
  171. <div>
  172. <img src="http://farm1.static.flickr.com/163/399223609_db47d35b7c_t.jpg" />
  173. <img src="http://farm1.static.flickr.com/135/321464104_c010dbf34c_t.jpg" />
  174. <img src="http://farm1.static.flickr.com/40/117346184_9760f3aabc_t.jpg" />
  175. <img src="http://farm1.static.flickr.com/153/399232237_6928a527c1_t.jpg" />
  176. </div>
  177.  
  178. <!-- 10-15 -->
  179. <div>
  180. <img src="http://farm4.static.flickr.com/3629/3323896446_3b87a8bf75_t.jpg" />
  181. <img src="http://farm4.static.flickr.com/3023/3323897466_e61624f6de_t.jpg" />
  182. <img src="http://farm4.static.flickr.com/3650/3323058611_d35c894fab_t.jpg" />
  183. <img src="http://farm4.static.flickr.com/3635/3323893254_3183671257_t.jpg" />
  184. </div>
  185.  
  186. </div>
  187.  
  188. </div>
  189.  
  190. <!-- "next page" action -->
  191. <a class="next browse right"></a>
  192. </div>
  193.  
  194.  
  195.  
  196.  
  197. </body>
  198. </html>
Go to the top of the page
+Quote Post
com
post
Post #6





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


daj tam zamiast
  1. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

to
  1. <script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>



a
Kod
<script type="text/javascript">
$(function() {
// initialize scrollable
$(".scrollable").scrollable();
});
</script>

najlepiej po
  1. <!-- "next page" action -->
  2. <a class="next browse right"></a>
  3. </div>


btw priv nie służy do rozwiązywania problemów (IMG:style_emoticons/default/wink.gif)

Ten post edytował com 25.09.2013, 18:41:53
Go to the top of the page
+Quote Post
Outside
post
Post #7





Grupa: Zarejestrowani
Postów: 63
Pomógł: 1
Dołączył: 28.08.2013

Ostrzeżenie: (0%)
-----


Jest jescze jeden problem, pomimo tego, że dobrze znam css to nie mam bladego pojęcia jak to rozwiązać.
Strzałki są tam zrobione takim zdjęciem
(IMG:http://jquerytools.org/media/img/scrollable/arrow/hori_large.png)
W jaki sposób mogę umieścić tam swoje strzałki na lewo i prawo?
Go to the top of the page
+Quote Post
com
post
Post #8





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


poczytaj na temat sprite css to rozwiąże twój problem (IMG:style_emoticons/default/wink.gif) nie żebym się prosił ale mogę liczyć na pomógł? (IMG:style_emoticons/default/tongue.gif) dlatego właśnie nie rozwiązuje się problemów na priv, ale to na przyszłość (IMG:style_emoticons/default/wink.gif)
Go to the top of the page
+Quote Post
Outside
post
Post #9





Grupa: Zarejestrowani
Postów: 63
Pomógł: 1
Dołączył: 28.08.2013

Ostrzeżenie: (0%)
-----


Oczywiscie, ze tak. juz dane (IMG:style_emoticons/default/smile.gif)
O sprite css nie wiedzialem, ale sie wlasnie dowiedzialem i wielkie dzieki za to, pozniej stestuje to wszystko jeszcze raz, dziekuje bardzo za pomoc (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 21:39