Java Review question 2

Source: Internet
Author: User

Carousel Diagram

Implementation results:

1. Change pictures every 1 seconds

2, the mouse hover over the picture when the cycle stops

3. Click on the previous, Next button picture to convert to previous, next

JS Code:

var tupian=null,

arr [],

Num=-1,

Setint=null;

Window.onlead=function () {

Tupian=document.getelementbyid ("TP");

arr=["1.png", "2.png", "3.png"];

Setint=setinterval (Funcution () {

Shang ();

},1000);

}

function Stopsetion () {

Clearinterval (Setint);

}

function Shang () {

if (num==-1) {

NUM1;

}

document.getElementById ("TP"). src=arr[num];num=num+1;

if (num>2) {

num=0;

}

}

Function Xia () {

if (num==-1{

num=arr.lenght-1;

}

document.getElementById ("TP"). Src=arr[num];

Num=num-1;

if (num<0) {

num=arr.lenght-1;

}

}

Java Review question 2

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.