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:
- Image proxy settings Flash + JavaScript
- Java docking PayPal to achieve automatic renewal function
- Practice — CSS3 — frame animation to achieve special effects
- VTK cultivation 26: basic operation of image_ Three dimensional image slice extraction
- Ueditor paste word image and upload image file automatically
- Three methods of JavaScript jump to new page
- How to use JavaScript in HTML
- PHP in Windows combined with bat batch processing to achieve multi process verification proxy server function
- Spring boot does not take effect when using @ size to verify a single set parameter of the control layer
- Solve the problem that better scroll lateral scrolling has no effect
- How to increase the effect of onchange event after adding readonly attribute to input tag and display time of laydate plug-in
- Vue element El input search to achieve anti shake @ input event requests frequently
- [docker] error in deleting image: image is referenced in multiple repositories
- When using CSS to write the registration page, we found that the editing effect is not effective
- Ant Design upload listtype = “picture card” realizes multi image upload and click preview image encapsulation
- JS error: permission denied to access property ‘document’— document.domain -The same source strategy of JavaScript
- Wechat applet animate animation does not implement animation effect for the first time
- Tensorflow image random_ There seems to be something wrong with the shift function
- Learn English together | three ways to realize digital factorial with JavaScript
- Use XMLHttpRequest of JavaScript to send data to the background