开发者

How to load an image from thumbnail to bigger size with Javascript

开发者 https://www.devze.com 2022-12-10 19:37 出处:网络
I load a series of images in html (via asp.net) and resized via classic html wid开发者_运维问答th:50%. Then I would like that if I press on the thumb, this image appear on top of my html page full siz

I load a series of images in html (via asp.net) and resized via classic html wid开发者_运维问答th:50%. Then I would like that if I press on the thumb, this image appear on top of my html page full sized, like the classical gallery, but without the effect and a lot jquery code. How can I do this with Javascript?

What is the Javascript command to load an element in an other page position?


There are many libraries like this, e.g. lightbox2

But if doing it yourself, you'll generally be messing with jQuery's css command, making the elements position: absolute, and setting up a mask element behind it, with partial opacity, to cover the rest of the content. Or if you want to be less obtrusive, which is better, setting and removing classes using jQuery's addClass and removeClass, and then defining the classes' style in CSS.

jQuery lightbox tutorial

0

精彩评论

暂无评论...
验证码 换一张
取 消