Click on a picture based on jquery mouse to turn on the switch effect

Source: Internet
Author: User

Based on the jquery mouse click on the picture switch effect is a JQUERY+CSS3 based on the implementation of the click image Switch effects. As follows:

Online preview Source Download

The implemented code.

HTML code:

<Divclass= "Container">        <imgsrc= "Images/1.jpeg"alt= "1" />        <imgsrc= "Images/2.jpeg"alt= "2" />        <imgsrc= "Images/3.jpeg"alt= "3" />        <imgsrc= "Images/4.jpeg"alt= "4" />        <imgsrc= "Images/5.jpeg"alt= "5" />    </Div>    <Divclass= "Name">        <P>No 1</P>    </Div>

JS Code:

$(function () {            varinterval; $(". Container img"). Click (functioncover () {$ ( This). addclass ("Zoom"). FadeOut (700, append); functionAppend () {$ ( This). Removeclass ("Zoom"). AppendTo (". Container"). Show (); varName = $ (". Container"). Children ("IMG"). First (). attr ("Alt"); $(". Name P"). Text ("No" +name); }            })            functionAuto () {varPlay = $ (". Container"). Children ("IMG")). First (); Play.addclass ("Zoom"). FadeOut (700, append); functionAppend () {$ ( This). Removeclass ("Zoom"). AppendTo (". Container"). Show (); varName = $ ( This). Parent (). Children ("IMG"). First (). attr ("Alt"); $(". Name P"). Text ("No" +name); } interval= SetTimeout (auto, 5000); }            $(". Container img"). Hover (function() {stopplay (); }, function() {interval= SetTimeout (auto, 5000); })            functionStopplay () {cleartimeout (interval)} auto (); })

via:http://www.w2bc.com/article/45764

Click on a picture based on jquery mouse to turn on the switch effect

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.