javascript - Creating a custom size new window with JS? -
I have an image that is linked to another image, which is 672 (W) x 792 (H ) - I would like to know what is the best way in JS that this image is completely fit in a new window when click on the image link? Without fitting the image in a new window, it is a left ally and looks ugly. markup: and JS: But keep in mind that pop-ups are really annoying for some users. Instead, I would suggest using you or any other lightbox.
& lt; a href = "linktoimg.jpg" target = "_ blank" onclick = "return popup (this.href);" & Gt; & Lt; img src = "yourimg.jpg" /> & Lt; / A & gt;
function popup (url) {t_window = window.open (url, "popupwindow", "width = 672, height = 792 , Resizable = yes "); t_window.focus (); return false; }
Comments
Post a Comment