Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CSS][PHP][AJAX]Tchickbox + Jak to wywołać?
organista18
post
Post #1





Grupa: Zarejestrowani
Postów: 40
Pomógł: 0
Dołączył: 22.07.2009

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


Witam poraz kolejny. Tym razem problem przypadł na thickboxa. Robię wszystko zgodnie z instrukcją na stronie. Lecz efektów brak. Oto kod:

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  6. <script type="text/javascript" src="../scripts/jquery.js"></script>
  7. <script type="text/javascript" src="../scripts/thickbox.js"></script>
  8. <style type="text/css" media="all">@import url(../scripts/thickbox.css);</style>
  9. </head>
  10. <body>
  11. <div class="box">
  12. <div class="text"><p><span class="clear styl1"><a href="include/inc_catarts_edit.php?height=285&width=350&modal=true" class="thickbox" title="Edycja wpisu">Edytuj</a></span></div>
  13. <div class="clear"></div>
  14. </div>
  15. </body>


Niby wszystko tak jak w instrukcji na stronie, pisali żeby dodać odpowiedni doctype, więc tak zrobiłem, ale niestety thickbox nie działa...

Z góry dzięki za pomoc (IMG:style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
organista18
post
Post #2





Grupa: Zarejestrowani
Postów: 40
Pomógł: 0
Dołączył: 22.07.2009

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


Właśnie nic...

Teraz przerzuciłem się na http://fancybox.net/howto i kod wygląda tak:
  1. <?php
  2. include("../_safe/inc_config.php");
  3. //error_reporting(0);
  4. if(login())
  5. {
  6. ?>
  7. <!----------------------------------------------------------------------------------------------------------------->
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  9. "http://www.w3.org/TR/html4/loose.dtd">
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  12. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  13. <script type="text/javascript" src="../scripts/jquery.js"></script>
  14. <script type="text/javascript" src="../scripts/jquery/jquery.easing.1.3.js"></script>
  15. <script type="text/javascript" src="../scripts/jquery/jquery.fancybox-1.2.1.pack.js"></script>
  16. <link rel="stylesheet" href="../scripts/jquery/fancybox.css" type="text/css" media="screen">
  17. <script type="text/javascript">
  18.  
  19. $(document).ready(function() {
  20. $('#load').hide();
  21. $('#edit').hide();
  22. $("a#edycja").fancybox();
  23. });
  24.  
  25. $(function() {
  26.  
  27. $(".delete").click(function() {
  28. $('#loader').fadeIn();
  29. var commentContainer = $(this).parent();
  30. var id = $(this).attr("id");
  31. var string = 'id='+ id ;
  32. $.ajax({
  33. type: "POST",
  34. url: "include/inc_catarts_delete_script.php",
  35. data: string,
  36. cache: false,
  37. success: function(){
  38. commentContainer.slideUp('slow', function() {$(this).remove();});
  39. $('#loader').fadeOut();
  40. }
  41.  
  42. });
  43.  
  44.  
  45.  
  46. return false;
  47. });
  48. });
  49.  
  50.  
  51. </script>
  52. <style type="text/css" media="screen">
  53. @import url(../src_img/style000.css );
  54. .styl1 {
  55. font-size: 16px;
  56. font-weight: bold;
  57. color: #000000;
  58. }
  59. .delete {
  60.  
  61. }
  62. a.delete {
  63.  
  64. }
  65. a.delete:hover {
  66.  
  67. }
  68. </style>
  69. </head>
  70.  
  71. <!----------------------------------------------------------------------------------------------------------------->
  72. <body>
  73.  
  74. <div id="container">
  75. <!----------------------------------------------------------------------------------------------------------------->
  76. <?php
  77.  
  78. $query = mysql_query("SELECT * FROM `mcms_catarts` ORDER BY nazwa_kategorii DESC");
  79. while($rekord = mysql_fetch_array($query))
  80. {
  81. ?>
  82. <div class="box">
  83. <div class="text"><p><span class="clear styl1"><?php echo $rekord[1]; ?></span></p>
  84. <p>Opis kategorii: <span class="info"><?php echo $rekord[2]; ?></span></p></div>
  85. &gt;<a href="#" id="<?php echo $rekord[0]; ?>" class="delete">Usuń</a> &gt;<a id="edycja" href="include/inc_catarts_edit.php?id=<?php echo $rekord[0]; ?>" title="Edycja wpisu">Edytuj</a>
  86. <div class="clear"></div>
  87. </div>
  88. <?php
  89. }
  90. ?>
  91. <!----------------------------------------------------------------------------------------------------------------->
  92. </div>
  93. <div id="edit">
  94. </div>
  95. </body>
  96. <!----------------------------------------------------------------------------------------------------------------->
  97. <?php
  98. }
  99. else if(!login())
  100. {
  101. echo "Nie masz dostępu do tej strony!";
  102. }
  103. ?>


Jeśli chodzi o fancyboxa, to zrobiłem wszystko jak napisali. Dodam jeszcze że ten kod jest ładowany do diva przy pomocy ajax'a, a cała strona wygląda tak:

http://mjsp.pl/mcms/edit.php?t=1&src=catarts

login i hasło: forumphp

Jak klikam usuń, to jest wszystko ok, skrypt usuwa dany wpis, jednak jak klikam edytuj, to zamiast fancybox'a, strona ładuje się na nowo...

Ten post edytował organista18 3.09.2009, 10:17:18
Go to the top of the page
+Quote Post

Posty w temacie


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: 15.10.2025 - 00:46