How to Create Image Slider in HTML, CSS & JS - Step by Step | JavaScript Projects

How to Create Image Slider in HTML, CSS & JS - Step by Step | JavaScript Projects

WsCube Tech

2 года назад

228,231 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Lets_develop_it
@Lets_develop_it - 08.08.2023 15:46

here is the solution for this bug
function Prev() {
if (counter == 0) {

} else {
counter++
slideimage()
}
};
function Next() {
if (counter == (slides.length*-1)+1) {

} else {
counter--
slideimage()
}
}

Ответить
@shivam3839
@shivam3839 - 09.08.2023 12:08

this series was pretty helpful, now i am comfortable in javascript

Ответить
@Rameshpuri81
@Rameshpuri81 - 13.08.2023 11:53

" 0 * 100 " = zero "0" hota h sir ,"1*100"= 100 hota h sir

Ответить
@Himanshua09
@Himanshua09 - 19.08.2023 15:59

I did the same as shown in video but I am getting error.
When I checked in console it is showing slides.forEach is not a function.
Please help

Ответить
@_justacoder_
@_justacoder_ - 30.08.2023 09:26

Loved it!! you made it super easy to understand

Ответить
@scriptpriest
@scriptpriest - 05.09.2023 02:46

What if we want the image slider to be like a wheel. So that when you click on the next button after the last image, the slider still slides forward but shows the first image instead of sliding backwards to the first image.
And vice versa

Ответить
@zaryabimran7303
@zaryabimran7303 - 05.09.2023 06:27

Can anyone tell me how he hoisted arrow function (slideImage()) 🤔🤔🤔

Ответить
@lyrichives7859
@lyrichives7859 - 13.09.2023 18:46

Thank youuu

Ответить
@_justacoder_
@_justacoder_ - 18.09.2023 12:29

where is the link for source code

Ответить
@vasudevpareek2862
@vasudevpareek2862 - 20.09.2023 09:36

the code is not working 😕

Ответить
@harikyt
@harikyt - 28.09.2023 13:59

awesome...bohot sahi

Ответить
@026maheshkumars7
@026maheshkumars7 - 02.10.2023 04:53

super

Ответить
@gkandcurrentaffairs7151
@gkandcurrentaffairs7151 - 06.10.2023 14:55

if you provide source code then it will easy bro

Ответить
@anumshehzadi-r3o
@anumshehzadi-r3o - 07.10.2023 15:15

VERY GOOD EXPLANATION, no destructive music, clear voice no jargon, no beating around the bush straight to the point every line explained THANK YOU VERY MUCH.

Ответить
@kholoudbelhadj
@kholoudbelhadj - 09.10.2023 14:25

how can I make them switch automatically

Ответить
@randykeetley9780
@randykeetley9780 - 12.10.2023 19:01

I did exactly what you did, and I even made sure that I did by checking my code. However, when I hit the next and previous buttons, you can tell they are being pressed however, the images don’t change at all

Ответить
@OneXHacker001
@OneXHacker001 - 03.11.2023 10:31

best javascript playlist which have helped me in getting a grip on javascript.

Ответить
@nabilaakhtar818
@nabilaakhtar818 - 07.11.2023 16:02

Where is the github link?

Ответить
@Chain25
@Chain25 - 11.11.2023 10:50

Welcome and Thanks a Lot.

Ответить
@TusharKumarPatel-ns1lo
@TusharKumarPatel-ns1lo - 11.11.2023 15:18

I tried it as it is but not working

Ответить
@BRAND_OF_UTTARPRADESH
@BRAND_OF_UTTARPRADESH - 08.12.2023 20:27

Please avoid text display on screen at code editor page

Ответить
@crazytthings47
@crazytthings47 - 21.12.2023 13:47

Sir this video help me a lot but meko js bilkul nhi samajta😢

Ответить
@moumajhi23
@moumajhi23 - 26.01.2024 11:54

code to stop the blank image that is when it is on 0 index previous button will be disabled , at the last index next button will be disabled ; I have done this - const slides = document.querySelectorAll(".slide");
let counter = 0;
const prevButton = document.querySelector(".prev");
const nextButton = document.querySelector(".next");
slides.forEach(
(slide, index)=>{
slide.style.left = `${index * 100}%`

})

const goPrevious =()=> {
nextButton.disabled = false;
if(counter === 0){
prevButton.disabled = true;
console.log(prevButton);
}
else{
prevButton.disabled = false;
counter = counter -1;
slideImage();


}
}
const goNext= ()=>{
prevButton.disabled = false;
if(counter === slides.length-1){
nextButton.disabled = true;

}
else{
nextButton.disabled = false;
counter = counter+1;
slideImage();
}

}

const slideImage = ()=>{
slides.forEach(
(slide)=>{
slide.style.transform = `translateX(-${counter * 100}%)`
}
)
}

Ответить
@FrameFablesTV
@FrameFablesTV - 10.02.2024 18:25

Excellent Explanation Sir!!!

Ответить
@VishalSharma-rn7mt
@VishalSharma-rn7mt - 11.02.2024 18:17

Awesome, very clear and easy

Ответить
@strangequard5702
@strangequard5702 - 01.03.2024 15:43

function gonext() {
if(count == 3){
return
}
count++
slider()
}
function gopreview() {
if(count == 0){
return
}
count--
slider()
}

Ответить
@Arbazbabu033
@Arbazbabu033 - 07.03.2024 15:39

Jquery se slick skider kese lagaye

Ответить
@kinzasheikh-xn9oe
@kinzasheikh-xn9oe - 25.03.2024 01:04

const slides = document.querySelectorAll(".slide")
var counter = 0;
slides.forEach(
(slide, index) =>{
slide.style.left = `$(index * 100)%`
}
)
const goPrev = () =>
{
counter--
slideImage()
}

const goNext = () =>
{
counter++
slideImage()
}


const slideImage = () =>
{
slides.forEach(
(slide) => {

slide.style.transform = `translateX(-${counter * 100}%)`

}
)
}

Ответить
@samandartursunov7205
@samandartursunov7205 - 25.03.2024 18:52

Thanks bro )

Ответить
@alaminmridha3138
@alaminmridha3138 - 09.04.2024 05:10

If you want the slide to start again after end, then you can use this code..😇😇
Thank You Everyone❣❣

const goNext = () => {
(counter == 3)? counter = -1: counter;
counter++;
slideImage();
};

const goPrev = () => {
(counter == 0)? counter = 4: counter;
counter--;
slideImage();
};

Ответить
@priyamittal8302
@priyamittal8302 - 28.04.2024 14:38

source code?

Ответить
@beinglearner8543
@beinglearner8543 - 30.04.2024 15:08

Error Index is not recognize

const slides = document.querySelectorAll(".slide")
var counter = 0;
console.log(slides)
slides.forEach(
(slide,index) => {
slide.style.bottom = '${index * 100}%'

}
)

index Error

Ответить
@MuhammadWaqas-eb1uu
@MuhammadWaqas-eb1uu - 01.05.2024 14:11

This project help me. And I create with help of slider automatically slide prev and Next.
Thanks Sir!

Ответить
@Devyadav0007
@Devyadav0007 - 17.05.2024 00:09

Ye Jo aap bolte h to likh jata h isse kafi dikkat hoti h

Ответить
@Lyrics_Editz2005
@Lyrics_Editz2005 - 30.05.2024 15:33

Sir iska source code kha Mila ga

Ответить
@himanshusoni2818
@himanshusoni2818 - 02.06.2024 16:40

GitHub link???

Ответить
@NANIANTIC
@NANIANTIC - 04.06.2024 12:42

const prev = () => {
if (counter > 0) {
counter--;
slideimg();
}
}

const nxt = () => {
if (counter < slides.length - 1) {
counter++;
slideimg();
}
}

Ответить
@peculiar_psa
@peculiar_psa - 13.06.2024 18:32

bhai kiska ye transition effect aa rah hai kya ?? mera pata nhi kyu sirf image change ho raha hai but transition me slide nhi ho rah!

Ответить
@nehaartgallery6319
@nehaartgallery6319 - 28.06.2024 16:20

What level of project should we done for internship

Ответить
@kaleemsipraa
@kaleemsipraa - 29.06.2024 19:57

nextbtn.addEventListener("click", () => {
counter = (counter + 1) % totalSlides;
changeSlide();
console.log(counter);
});
prevbtn.addEventListener("click", () => {
counter = (counter - 1 + totalSlides) % totalSlides;
changeSlide();
console.log(counter);

});

Ответить
@SurajMule-i8o
@SurajMule-i8o - 30.06.2024 06:36

Wa wa wa kya teaching mja aa gya ❤❤ 1 no sir 🎉

Ответить
@Ranaali069
@Ranaali069 - 24.07.2024 15:56

nice

Ответить
@apaarjain
@apaarjain - 06.08.2024 08:16

Waste of time. Incomplete

Ответить
@bhumikasethi7175
@bhumikasethi7175 - 08.08.2024 10:01

Not working

Ответить
@MuntasirMamunRony
@MuntasirMamunRony - 16.08.2024 16:44

sir pehle haddi to banalo fir style lagana!

Ответить
@Sunny-cx8ki
@Sunny-cx8ki - 14.09.2024 18:48

Seriously man, this helped me a lot, thank you very much

Ответить
@amir8reza536
@amir8reza536 - 15.09.2024 12:46

Thank you for this video 🙏🏻

Ответить
@nistaff9319
@nistaff9319 - 18.10.2024 19:39

it doesn't work thank you for wasting my time

Ответить
@AnonymousMaiden
@AnonymousMaiden - 08.11.2024 18:32

thanks a lot sir, this video helped me a lot i regret why haven't i came here before wasting my hours on coding

Ответить
@LizanSarkar-e5e
@LizanSarkar-e5e - 23.11.2024 17:35

good work help to me.

Ответить