4:20 PM A simple example of Image slider in HTML and Javascript |
Many times we have to add an image slider or banner on the home page of a website. This usually contains a set of rotating imgaes containing links to most important contents of your website. So an image slider gives an attractive look to your website and exhibites a nice presentation of your contents. Here we will learn to create a basic image slider using HTML and Javascipt. We will just put a set of images and then we will give it animation. There will be two button that can be used to move the picture slider left and right. In the Body tag we will put below code that is simply adding a set of images. Also, it will add two picture buttons that can be used to move printers left and right.
In the head tag, we put following script. The below script is working on click of the small picture buttons having ids moveleft,moveright. On click of them, we call a function to animate the pictures. We have decremented the left margin by some value to move it left and incremented it to move it right. The pictures are having id "div1" which is used to animate.
Also, this script is using JQuery, so make sure you place the jquery.js script at the same place/folder where your image and HTML file is. You can get the source code here |
|
Related blogs
You may also like to see:
[2014-01-28] | [Technical Solution] |
How to design a 3D object for a game using Blender. |
[2014-12-28] | [Technical Solution] |
How to schedule a mail in outlook to be sent later? |
[2014-09-30] | [Technical Solution] |
How to give a global url to an HTML page? How to create a website with custom url? |
[2015-01-26] | [Technical Solution] |
How to change IP address of windows system |
[2014-05-02] | [Technical Solution] |
A very basic program in perl scripting |
Total comments: 0 | |