Home  >  Article  >  Web Front-end  >  jQuery click thumbnail popup layer to display large picture_jquery

jQuery click thumbnail popup layer to display large picture_jquery

WBOY
WBOYOriginal
2016-05-16 16:14:10939browse

In the busy January of 2015, there is no more time to learn the ASP.NET MVC program. February is the Chinese New Year again. After a half-month holiday, I hope to return to my hometown and live in a world without computers and Internet. In these days, I can spend more time with my elderly parents.

Today, I will learn about jQuery and apply it to pictures. The user clicks on the picture to enlarge the picture.

Create a controller FebY15Controller:

Next create the view Index:

Mark 1, add image style:

Mark 2, add htm code, original image display and placeholder div tag for enlarging the image:

Mark 3, referencing the jQuery class library.

Mark 4, write jQuery program:

The following is a dynamic demonstration:

In this article, you can learn about jQuery’s click event. Use the tag.style class to get the object (img.thumb). Use $(this) to code the object itself. .attr("scr") gets the image src image path. Another one is the .animate() dynamic event.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn