Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pop-up tylko na stronie głównej, Jak wymusić pop-up na tylko jednej stronie (bez cookies)
julss
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 17.10.2006

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


Witajcie!
Mam gotowy skypt do Pop-up na str. głównej.
Niestety po kliknięciu newsa pop-up ładuje się od nowa. (News wygląda tak:
  1. .../index.php?id=321
)
Jak wymusić Pop-up tylko na stronie głównej,
najlepiej bez użycie cookies by wszystkim się ładował pop-up.

Uwaga! Pisze kompletny laik! blink.gif

  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
  2. <script type="text/javascript">
  3. $(document).ready(function() {
  4.  
  5. var id = '#dialog';
  6.  
  7. //Get the screen height and width
  8. var maskHeight = $(document).height();
  9. var maskWidth = $(window).width();
  10.  
  11. //Set heigth and width to mask to fill up the whole screen
  12. $('#mask').css({'width':maskWidth,'height':maskHeight});
  13.  
  14. //transition effect
  15. $('#mask').fadeIn(1000);
  16. $('#mask').fadeTo("slow",0.8);
  17.  
  18. //Get the window height and width
  19. var winH = $(window).height();
  20. var winW = $(window).width();
  21.  
  22. //Set the popup window to center
  23. $(id).css('top', winH/2-$(id).height()/2);
  24. $(id).css('left', winW/2-$(id).width()/2);
  25.  
  26. //transition effect
  27. $(id).fadeIn(2000);
  28.  
  29. //if close button is clicked
  30. $('.window .close').click(function (e) {
  31. //Cancel the link behavior
  32. e.preventDefault();
  33.  
  34. $('#mask').hide();
  35. $('.window').hide();
  36. });
  37.  
  38. //if mask is clicked
  39. $('#mask').click(function () {
  40. $(this).hide();
  41. $('.window').hide();
  42. });
  43. });
  44.  
  45. </script>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
Sebek87
post
Post #2





Grupa: Zarejestrowani
Postów: 74
Pomógł: 24
Dołączył: 21.10.2012
Skąd: Puławy

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


Bez użycia cookies okienko będzie wyświetlać się za każdym razem, gdy użytkownik powróci na stronę główną.
Obejmij ten kod JS instrukcją warunkową:
  1. <?php if(!isset($_GET['id'])): ?>
  2. // wyświetl okienko (kod js)
  3. <?php endif; ?>


Ten post edytował Sebek87 1.11.2012, 13:52:58
Go to the top of the page
+Quote Post
julss
post
Post #3





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 17.10.2006

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


SUPER! O to chodziło! Wielkie dzięki wink.gif
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 20.08.2025 - 01:02