Mam taka funkcje JS do otwierania zdjęcia w nowym oknie.
function imgDisplayPopup(url) { var imageWindow = window.open(url,'image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'); imageWindow.focus(); } function folderPopup(url) { var win = window.open(url, 'folder'); win.focus(); } // This function goes into the attic. It's sole purpose now is to be backwards compatible. RIP. function imgPopup(url) { var imageWindow = window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'); + "<style>\n" + "body { margin: 0px; }\n" + "</style>\n" + "<img src=\"" + url + "\" border=\"0\" name=\"image\"/>" imageWindow.document.open(); imageWindow.document.write(html); imageWindow.document.close(); imageWindow.focus(); }
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?