开发者

Clicking on a picture thumbnail and expanding to the center with javascript

I don't know the best way to ask this, but I will give it a try.

I have thumbnails of 3 photos corresponding to peoples bios. I am trying to have the thumbnails listed by the bios then give the user the ability to click a thumbnail and have the picture expand to the middle of the screen. When the user clicks off of the picture, the page returns to normal.

I am sure there is a term for this and I am sure it is an easy jQuery method, but I a开发者_如何学Gom having trouble locating the code to do so.

Thanks for any help!

Ryan


The term is a lightbox. There any many jQuery lightbox plugins. I've had great experience with FancyBox.

To use them, you could target all anchor tags which have direct children img tags, for instance:

$('a:has(img)').fancybox();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜