Click a small image to display the big image effect based on the jQuery plug-in.

Source: Internet
Author: User

Click a small image to display the big image effect based on the jQuery plug-in.

The example in this article shows you how to click a small Graph Based on jQuery to display the large image. The details are as follows:

Show the followingEffect:

Click any image to display a large image.:

1. Front-End Interface

<% @ Page Language = "C #" AutoEventWireup = "true" CodeBehind = "WebForm1.aspx. cs" Inherits = "exercise. WebForm1" %> <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

2. Background code

Using System; using System. collections. generic; using System. linq; using System. web; using System. web. UI; using System. web. UI. webControls; using System. data. sqlClient; using System. data; using System. text; namespace exercise {public partial class WebForm1: System. web. UI. page {protected void Page_Load (object sender, EventArgs e) {if (! IsPostBack) {LoadData () ;}} private void LoadData () {string constr = "data source = LOVE-PC \ SQLEXPRESSPC; initial catalog = BoKe; user id = sa; password = admin "; using (SqlConnection conn = new SqlConnection (constr) {using (SqlCommand cmd = conn. createCommand () {conn. open (); cmd. commandText = "select BigImgUrl, SmallImgUrl from T_Photo"; SqlDataAdapter adapter = new SqlDataAdapter (cmd); DataTable dt = new DataTable (); adapter. fill (dt); StringBuilder sb = new StringBuilder (); sb. append ("<ul>"); for (int I = 0; I <dt. rows. count; I ++) {sb. append ("<a href =" + dt. rows [I] ["BigImgUrl"] + ">"); // Add the image path sb. append ("<li>"); sb. append ("

The above is all the content of this article, hoping to help you learn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.