Javascriptdom code application simple album [firefoxonly] _ image effects

Source: Internet
Author: User
I have been very interested in front-end development recently, especially with the help of popular ajax libraries such as jquery, it is indeed convenient to make good dynamic effects even if I do not have good javascript skills. But I don't think that's enough. After all, everything is encapsulated by others. You have to study native javascript in depth to be steadfast. Today, I saw a good blog and introduced an example of an album Based on Javascript dom programming. Although this example is very small, I personally think it is of great learning value. First, I will give html and, this will help you understand the JavaScript code later.

The Code is as follows:




Snapshots


























The structure is quite simple. Here, the href attribute value of element a is the path of the big image to be displayed, and the img is the corresponding small image. The effect is to click the small image below, and the corresponding big image is displayed above.
The js implementation is given below:

The Code is as follows:


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.