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:

  & lt; a href = "linktoimg.jpg" target = "_ blank" onclick = "return popup (this.href);" & Gt; & Lt; img src = "yourimg.jpg" /> & Lt; / A & gt;   

and JS:

  function popup (url) {t_window = window.open (url, "popupwindow", "width = 672, height = 792 , Resizable = yes "); t_window.focus (); return false; }   

But keep in mind that pop-ups are really annoying for some users.

Instead, I would suggest using you or any other lightbox.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -