JavaScript to achieve image rotation effect

JavaScript implements the image rotation effect
Process is as follows:
create a div element in the body, two pictures in the div definition, add links to images, and set up the hyperlink tag a name attribute value of I.

<div id="tabs">
        <a name="i" href="#"><img src="images/1.jpg" width="100%" height="350px" alt=""></a>
        <a name="i" href="#"><img src="images/2.jpg" width="100%" height="350px" alt=""></a>
    </div>

The CSS part:

 #tabs{
            width:100%;
            height: 350px;
            overflow: hidden;
            float: left;
            position: relative;
        }

Javascript parts:
application document object getElementsByName () way to get the name attribute value for the I element, and then create a custom function changeimage (), the application of the setInterval () method, to do this every few seconds changeimage () function, control the rotation time.

Read More: