Skip to main content

How to Create Slideshow using JavaScript ?

How to Create Slideshow using JavaScript?




In this blog I am wiritng about slider (webiste slideshow) . You can implement this using javascript. Implementing this unig javascript is very easy. You can do this using CSS only but that is bit difficult. In this tutorial I am creating two button next and previous and when you clcik n that image changes.

First understand that How slider works ?

Slider basically works on hiding one image and showing the next image. So we have to write a function which hides an image and show another image.
Just look after line number 79

Now after looking at function you got some idea that I am hiding one image and shoing other image.
I had created a global variable where I store current Active image and use that variable to hide the current image.
After hiding current image I update the value of that If the function is next() then I add +1 and if the function is pre() then I -1 from that variable.

After hiding and updating there is one more step that new value is valid or not.
Valid ?
Yes, Valid because suppose going next and next we reach the last image and when we click on next nothing is showing. So, for that, we need to verify that new variable(after updating) should be within the range of children of ul.

I hope you understand this tutorial 

Comments

Popular posts from this blog

Various field of programming IT | programming career

In which Field of Programming I should go? I am going to tell you all about some of the trending/common fields of Programming. If you are confused then this blog is definitely for you. 1. Algorithmist 2. Web Developer 3. Mobile Application  4. Desktop Application 5. Game Developer 6. Security / Hacking 7. Database Administrative (DBA) In this video, I had discussed the various field of Programming and I had also discussed that what programming is needed you need to pursue. if you want to know about any other field of programming you can email me or comment on my video I will make a video on that and that will help everyone YouTube Link:  link to video Email : nitishk72@gmail.com I had discussed some of the trending fields of programming these or those filled in which people generally pursue their career. Thank you

How to setup Firebase ?

How to Setup Firebase in WEB Step 1 :   Download NodeJS  (LTS) and Install it. You can download any from these two . I'll suggest you to go with 8.9.3 LTS . Step 2 : Install Firebase CLI npm install -g firebase-cli Step 3 : Open Command Prompt and Login to Firebase. firebase login Step 4 : Initialise Firebase App in the desired directory firebase init Step 5 : Deploy Your Project firebase deploy