Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [inne][JavaScript]Przewijanie
Forum PHP.pl > Forum > Przedszkole
xxdrago
Witam, jak mogę zrobić takie przewijanie? że jak kliknę w strzałkę w bok to mi przewija sponsorów? Dla zrozumienia:

lobopol
javascript i zdarzenie onlclick + modyfikacja marginesów. Albo prościej jQuery + jedna z wielu wtyczek sliderów bądź samemu napisanie prostej funkcji.
erix
*carousel [;
xxdrago
Można tak powiedzieć że dałem rade wink.gif tylko jak mogę zrobić żeby kilku było kilku partnerów na raz a nie tylko jeden (1 się teraz wyświetla);
freefrag.89.pl

  1. <?php
  2. /*------------------------------------------------------------------
  3. Smart Blue Theme 1.1
  4. by SoulSmasher (http://www.soulsmasher.net)
  5. You Can Use And Share the theme as much as you want
  6. but please don't remove copyright of theme
  7. -------------------------------------------------------------------*/
  8. if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
  9. require_once INCLUDES."theme_functions_include.php";
  10.  
  11. define("THEME_WIDTH", "900");
  12. define("THEME_BULLET", "&middot;");
  13.  
  14. //v7 sublinks function is a bit more for this, so taken from v6 and tweaked
  15. function thesublinks($sep="&middot;",$class="") {
  16. $i = 0; $res = "";
  17. $sres = dbquery("SELECT * FROM ".DB_PREFIX."site_links WHERE link_position>='2' AND ".groupaccess('link_visibility')." AND link_url!='---' ORDER BY link_order ASC");
  18. if (dbrows($sres)) {
  19. while($sdata = dbarray($sres)) {
  20. if ($i != 0) { $res .= " ".$sep."\n"; } else { $res .= "\n"; }
  21. $link_target = $sdata['link_window'] == "1" ? " target='_blank'" : "";
  22. $link_class = $class ? " class='$class'" : "";
  23. if (strstr($sdata['link_url'], "http://") || strstr($sdata['link_url'], "https://")) {
  24. $res .= "<a href='".$sdata['link_url']."'".$link_target.$link_class.">".$sdata['link_name']."</a>";
  25. } else {
  26. $res .= "<a href='".BASEDIR.$sdata['link_url']."'".$link_target.$link_class.">".$sdata['link_name']."</a>";
  27. }
  28.  
  29. $i++;
  30. }
  31. }
  32. if ($i != 0) { return $res; } else { return "&nbsp;"; }
  33. }
  34.  
  35. function render_page($license=false) {
  36. global $settings, $main_style;
  37.  
  38. // jquerty
  39. <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'></script>
  40. <script type='text/javascript' src='http://dawidesign.ugu.pl/js/jquery-1.2.6.pack.js'></script>
  41. <script type='text/javascript' src='http://dawidesign.ugu.pl/js/stepcarousel.js'></script>
  42. <script type='text/javascript'>
  43. stepcarousel.setup({
  44. galleryid: 'mygallery', //id of carousel DIV
  45. beltclass: 'belt', //class of inner 'belt' DIV containing all the panel DIVs
  46. panelclass: 'panel', //class of panel DIVs each holding content
  47. autostep: { enable: true, moveby: 1, pause: 3000 },
  48. panelbehavior: { speed: 350, wraparound: false, persist: true },
  49. defaultbuttons: { enable: true, moveby: 1, leftnav: ['http://img121.imageshack.us/img121/9486/lewot.png', -520, 53], rightnav: ['http://img39.imageshack.us/img39/6523/prawo.png', 45, 63] },
  50. statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
  51. contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
  52. })
  53. </script>
  54. <style type='text/css'>
  55.  
  56. .stepcarousel{
  57. position: relative; /*leave this value alone*/
  58. border: 0px;
  59. overflow: scroll; /*leave this value alone*/
  60. width: 300px; /*Width of Carousel Viewer itself*/
  61. height: 120px; /*Height should enough to fit largest content's height*/
  62. margin-left:525px;
  63. }
  64.  
  65. .stepcarousel .belt{
  66. position: absolute; /*leave this value alone*/
  67. left: 0;
  68. top: 0;
  69. }
  70.  
  71. .stepcarousel .panel{
  72. float: left; /*leave this value alone*/
  73. overflow: hidden; /*clip content that go outside dimensions of holding panel DIV*/
  74. margin: 2px; /*margin around each panel*/
  75. width: 200px; /*Width of each panel holding each content. If removed, widths should be individually defined on each content DIV then. */
  76. }
  77. </style> ";
  78.  
  79. //Header
  80. echo "<table cellpadding='0' cellspacing='0' width='".THEME_WIDTH."' align='center'><tr><td>
  81. <table cellpadding='0' cellspacing='0' width='".THEME_WIDTH."' style='border: 0px; margin: 0px auto'>
  82. <tr><td background='".THEME."images/header.png' alt='' width='900' height='146'></td></tr></table>\n";
  83.  
  84. //sublinks css
  85. echo "<table width='".THEME_WIDTH."' border='0' cellspacing='0' cellpadding='0'><tr><td>";
  86. echo "<div id='altlinkler'>";
  87. echo "<ul><li>".thesublinks("</li>\n<li>");
  88. echo "</li></ul><div class='clear-both'>&nbsp;</div></div>";
  89. echo "</td></tr></table>";
  90.  
  91. //Content
  92. echo "<table cellpadding='0' cellspacing='0' width='".THEME_WIDTH."'>\n<tr>\n";
  93. if (LEFT) { echo "<td class='side-border-left' valign='top'>".LEFT."</td>"; }
  94. echo "<td class='main-bg' valign='top'>".U_CENTER.CONTENT.L_CENTER."</td>";
  95. if (RIGHT) { echo "<td class='side-border-right' valign='top'>".RIGHT."</td>"; }
  96. echo "</tr>\n</table>\n";
  97.  
  98. //sponsors
  99. echo "<div id='sponsors'>
  100. <div style='margin-left:-1px;margin-top:0px;float:left;'>
  101. <div id='mygallery' class='stepcarousel'>
  102. <div class='belt'>
  103.  
  104.  
  105. <div class='panel' align='left' style='margin-top: 30px;'>
  106. <div align='center'>
  107. <img src='http://easygraph-cms.pl/demo1n/img/eg.png' alt='' border='0' />
  108. </div>
  109. </div>
  110.  
  111. <div class='panel' align='left' style='margin-top: 30px;'>
  112. <div align='left'><a href=''><img src='http://easygraph-cms.pl/demo1n/img/eg.png' alt='' border='0' /></a></div>
  113. </div>
  114.  
  115. <div class='panel' align='left' style='margin-top: 30px;'>
  116. <div align='left'><a href=''><img src='http://easygraph-cms.pl/demo1n/img/eg.png' alt='' border='0' /></a></div>
  117. </div>
  118.  
  119. </div>
  120. </div>
  121. </div>
  122. </div>";
  123.  
  124. //Footer
  125. echo "<div id='footer'><table cellpadding='0' cellspacing='0' width='".THEME_WIDTH."' class='footermain'>
  126. <tr>
  127. <td class='footerleft'>Powered by PHP-Fusion copyright &copy; 2002 - 2011 by Nick Jones.</td>
  128. <td class='footerright'>
  129. Theme By SoulSmasher edit by XxDrago</strong>
  130. </td>
  131. </tr>
  132. </table>
  133. </div>
  134.  
  135. </td></tr></table>
  136. \n";
  137. }
  138.  
  139.  
  140. function render_news($subject, $news, $info) {
  141.  
  142. echo "<div class='capmain'>$subject</div>\n";
  143. echo "<div class='main-body floatfix'>".$news."</div>\n";
  144. echo "<div class='news-footer'>\n";
  145. echo newsposter($info,"&middot;").newsopts($info,"&middot;").itemoptions("N",$info['news_id']);
  146. echo "</div>\n";
  147. }
  148.  
  149. function render_article($subject, $article, $info) {
  150. echo "<div class='border tablebreak'>";
  151. echo "<div class='capmain'>$subject</div>\n";
  152. echo "<div class='main-body floatfix'>".($info['article_breaks'] == "y" ? nl2br($article) : $article)."</div>\n";
  153. echo "<div class='news-footer'>\n";
  154. echo articleposter($info,"&middot;").articleopts($info,"&middot;").itemoptions("A",$info['article_id']);
  155. echo "</div>\n";
  156. echo "</div>";
  157. }
  158.  
  159. function opentable($title) {
  160.  
  161. echo "<table cellpadding='0' cellspacing='0' width='100%' class='border tablebreak'>
  162. <tr>
  163. <td class='capmain'>$title</td>
  164. </tr>
  165. <tr>
  166. <td class='main-body'>\n";
  167.  
  168. }
  169.  
  170. function closetable() {
  171.  
  172. echo "</td>
  173. </tr>
  174. </table>\n";
  175.  
  176. }
  177.  
  178.  
  179. function openside($title, $collapse = false, $state = "on") {
  180. echo "<div class='border tablebreak'>";
  181. global $panel_collapse; $panel_collapse = $collapse;
  182.  
  183. echo "<div class='border'>\n";
  184. echo "<div class='scapmain'>";
  185. if ($collapse == true) {
  186. $boxname = str_replace(" ", "", $title);
  187. echo "<div style='float:right;'>".panelbutton($state,$boxname)."</div>";
  188. }
  189. echo $title."</div>\n<div class='side-body floatfix'>\n";
  190. if ($collapse == true) { echo panelstate($state, $boxname); }
  191.  
  192. }
  193.  
  194. function closeside($collapse = false) {
  195.  
  196. global $panel_collapse;
  197.  
  198. if ($panel_collapse == true) { echo "</div>\n"; }
  199. echo "</div>\n</div>\n";
  200. echo "</div>";
  201.  
  202. }
  203.  
  204. ?>
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.