Zoom in a new window?

I just quickly looked through my question and could not find anything right on the spot.

I am still very new to HTML and was wondering if anyone could tell me how I could add a picture to my site and install the code so that by clicking on it it enlarges the image in a new window.

I am going to add about 600 photos to my site, so I am also wondering if there is a way to write the code once and apply it to all the files I add.

Thanks in advance, - Danny B.

+3
source share
5 answers

There are many ways you could do this. The basic HTML for inserting an image with a link to a new window will be:

<a href="enlarged.html" target="_blank">
     <img src="photos/photo-name.jpg" />
</a>

, . , - PHP, HTML- 600 . , , , , , / javascript, .

script. , - .

+3

, , , , " ".

: http://colorpowered.com/colorbox/

... " ", .

HTML JQuery. .

0

Google, lightbox. Javascripts. , /, onload . Lightbox2 jQuery Lightbox plugin.

0

w/target = "_ blank" - Lightbox2 , , , . , , - , , . , / , w/coding, .

. , , .

,  -

0

The easiest way is to add a link to it and set the attribute targetto target="_blank". The link should point to the image. This will allow you to regularly open a new tab, but if you want to create a completely new window, try

href="javascript:window.open('myimage.png','_blank','toolbar=no,menubar=no,resizable=yes,scrollbars=yes')"
which will open a new standalone window. If you are looking for fading / resizing effects, etc., try one of the other posted answers.
-1
source

Source: https://habr.com/ru/post/1734969/


All Articles