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:
[2024-03-27] | [Technical Solution] |
How to discuss on Performance Appraisal with your manager? 10 Points to help you get a better hike |
[2022-07-24] | [Technical Solution] |
How to handle Criticism at work? An Insight by Mark Goulston (Harvard's Business review article) |
[2014-03-01] | [Technical Solution] |
RSS feed: what is it and how to use it? |
[2015-01-26] | [Technical Solution] |
How to change IP address of windows system |
[2014-07-13] | [Technical Solution] |
Create an online megastore in your website by adding a shopping cart(eSHOP) |
Total comments: 0 | |