E
E
Egor Ogurtsov2014-07-08 13:49:48
JavaScript
Egor Ogurtsov, 2014-07-08 13:49:48

How to enlarge an image on click without wrapping it in a link?

On the site page there is a large image reduced using css-properties. The picture is not included in the link. What's the easiest way to show an image in a lightbox without wrapping it in a link to itself with a plugin class? Dozens of plug-ins found require that the image be wrapped in a link.

Thanks please!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Popolov, 2014-07-08
@mrdubz

If you use jquery, then you can do this (this is a quick guess, just to demonstrate): jsfiddle.net/95ACL . But that's just a quick guess.
In general, in most plugins, the link itself does not play a role, maybe span, unless it is tied to href or rel.

N
nSnayp, 2014-07-08
@nSnayp

Well, firstly, this is not the same picture, but a cropped preview to reduce the load on the user, and the second is the original, so that he looks at it.
Write your own function that takes attr src from this and uses it to insert into the module window with the dimensions you need. Hang the function on onclick and that's it ... But what's the point ..?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question