Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Funkcje js do popupa, otwierane okno jest zbyt male.
MalyKazio
post
Post #1





Grupa: Zarejestrowani
Postów: 168
Pomógł: 1
Dołączył: 19.11.2005

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


Witam,

Mam taka funkcje JS do otwierania zdjęcia w nowym oknie.

  1. function imgDisplayPopup(url)
  2.  
  3. {
  4.  
  5. var imageWindow = window.open(url,'image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
  6.  
  7. imageWindow.focus();
  8.  
  9. }
  10.  
  11. function folderPopup(url)
  12.  
  13. {
  14.  
  15. var win = window.open(url, 'folder');
  16.  
  17. win.focus();
  18.  
  19. }
  20.  
  21. // This function goes into the attic. It's sole purpose now is to be backwards compatible. RIP.
  22.  
  23. function imgPopup(url)
  24.  
  25. {
  26.  
  27. var imageWindow = window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
  28.  
  29. html = "<html><head><title></title>"
  30.  
  31. + "<style>\n"
  32.  
  33. + "body { margin: 0px; }\n"
  34.  
  35. + "</style>\n"
  36.  
  37. + "</head><body bgcolor=\"#000000\" onload='window.resizeTo(document.image.width,document.image.height)'>"
  38.  
  39. + "<img src=\"" + url + "\" border=\"0\" name=\"image\"/>"
  40.  
  41. + "</body></html>";
  42.  
  43. imageWindow.document.open();
  44.  
  45. imageWindow.document.write(html);
  46.  
  47. imageWindow.document.close();
  48.  
  49. imageWindow.focus();
  50.  
  51. }


Funkcja działa, tylko otwierane okno jest zbyt male. Zdjęcie jest odrobinę ucinane. Z tego co zauważyłem o szerokość górnego i dolnego paska przeglądarki. Nie znam się zupełnie na JS. Jak dodać do wysokości otwieranego okna ze 40 pikseli?
Na pewno trzeba zmienić
Kod
onload='window.resizeTo(document.image.width,document.image.height)'>"


Ale jak?


--------------------
"Jak Cię widzą tak Cię piszą, chyba żeś jest wielką fiszą"
Go to the top of the page
+Quote Post

Posty w temacie


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: 21.08.2025 - 11:32