Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [JavaScript][PHP]Przewijana zawartość strony problem
Forum PHP.pl > Forum > Przedszkole
bobik127
Witam dostałem od kolegi skrypt przewijania zawartości strony za pomocą js skrypt u niego działa na php-fusion u mnie już nie, po kliknięciu na strzałkę nie przewija, prosił bym o pomoc bo już nie mam pomysłów jak to zrobić smile.gif

pierwszy plik:

  1. <?
  2. if(!defined("IN_FUSION")){ die("Access Denied"); }
  3.  
  4. <div class='cars-top'>
  5. <h1 class='fury'>
  6. <img src='".THEME."images/nowe_fury.png' alt='nowe fury' class='fury'></h1>";
  7.  
  8.  
  9. $_POST['page'] = '0';
  10. require "cars_data.php";
  11.  
  12.  
  13.  
  14. <a href='java script: void(0)' class='a_arrow_up_b' id='T-gallery-up' title='W górę'><img src='".THEME."images/green_arrow.png' alt='strzalka w góre' class='arrow-up'></a>
  15. <a href='java script: void(0)' class='a_arrow_up_down' id='T-gallery-down' title='W dół'><img src='".THEME."images/green_arrow.png' alt='strzalka w góre' class='arrow-down'></a>
  16.  
  17.  
  18. </div>
  19. ";
  20.  
  21. ?>


drugi plik
  1. <?
  2. if(!defined("IN_FUSION")){
  3. header("Cache-Control: no-cache");
  4. header("Pragma: nocache");
  5. header('Content-type: text/html;charset=iso-8859-2');
  6. require_once "../../../maincore.php";
  7. }
  8. if(!isset($_POST['page']) || !isNUM($_POST['page'])){ die("Błąd"); }
  9.  
  10. $result = dbquery("SELECT(SELECT Count(*) FROM ".$db_prefix."photos".") AS Photos");
  11. $data = dbarray($result);
  12. $result=dbquery(
  13. "SELECT tp.photo_id, tp.photo_title, tp.photo_thumb1, ta.album_id, ta.album_title FROM ".$db_prefix."photos tp
  14. LEFT JOIN ".$db_prefix."photo_albums"." ta USING(album_id)
  15. WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT ".($_POST['page']*4).",4");
  16.  
  17.  
  18.  
  19.  
  20. $a = '0';
  21. while ($data=dbarray($result)) {
  22. $randphotodir = IMAGES."photoalbum/".(!@ini_get("safe_mode") ? "album_".$data['album_id']."/" : "");
  23. $photo_file = $randphotodir.$data['photo_thumb1'];
  24.  
  25.  
  26.  
  27. <div class='car1 car-global' style='background-image: url(".BASEDIR."".$randphotodir.$data['photo_thumb1'].");'>
  28. <a href='".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' title='".$data['photo_title']."'>
  29. <span class='podpowiedz'>".$data['photo_title']."</span></a>
  30. </div>";
  31. $a++;
  32.  
  33. }
  34.  
  35. ?>


akcja w js

  1. function get_gallery_mainpage(id) {
  2. jQuery.post(BASE + "themes/Gillette/panele/cars_data.php", {
  3. page: id
  4. }, function (data, status) {
  5. if (status == "success" && data != "") {
  6. RevertAll();
  7. jQuery('.T-gallery-imgs ul').animate({
  8. opacity: 0
  9. }, "normal", function () {
  10. jQuery(this).html(data);
  11. set_img_zoom();
  12. jQuery(this).animate({
  13. opacity: 1
  14. }, "normal")
  15. });
  16. if (id == 0) {
  17. jQuery('#T-gallery-up').attr('class', 'a_arrow_up_b')
  18. } else {
  19. if (jQuery('#T-gallery-up').attr('class') == "a_arrow_up_b") {
  20. jQuery('#T-gallery-up').attr('class', 'a_arrow_up')
  21. }
  22. }
  23. if (jQuery('#T-gallery-down').attr('class') == "a_arrow_down_b") {
  24. jQuery('#T-gallery-down').attr('class', 'a_arrow_down')
  25. }
  26. C_gallery_page = id
  27. } else {
  28. jQuery('#T-gallery-down').attr('class', 'a_arrow_down_b')
  29. }
  30. }, "html")
  31. };
Kshyhoo
1. To jakaś modyfikacja?
2. java script != javascript
bobik127
Tak modyfikacja.
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.