How to display enlarged images upon click in a new pop up window similar to Twitter?
An image on Twitter, will enlarge in a pop up window which can be closed using the x. I have seen similar questions such as How to expand an image in HTML by clicking on it but I want the image to open, enlarged, in a separate window rather than being enlarged on the page.
At the moment, I realize <a></a> tags are commonly used to achieve enlarged images, but a pop up window seems more aesthetically pleasing.
The inner <img/> tag will display the image from the url (which can be a local directory in your project such as "/images/test.jpg" or an external source). The <a></a> tag surrounding it will make the image clickable and open the href in a new window because the target is set as above.
Asked in February 2016Viewed 1,966 timesVoted 4Answered 1 times