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

Поделиться
HTML-код
  • Опубликовано: 18 янв 2025

Комментарии • 154

  • @anumshehzadi-r3o
    @anumshehzadi-r3o Год назад +13

    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.

  • @strangequard5702
    @strangequard5702 10 месяцев назад +4

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

  • @sajadhamid2000
    @sajadhamid2000 Год назад +7

    My favourite tutor on internet

  • @FrameFablesTV
    @FrameFablesTV 11 месяцев назад +1

    Excellent Explanation Sir!!!

  • @srinivasaraoyp3640
    @srinivasaraoyp3640 2 года назад +3

    Aapka explain karnay ka tarika bahuth badiya. Thank you very much.

  • @MaanIsMe
    @MaanIsMe 2 года назад +36

    It's was easy😅, just takes a little thinking.
    const goNext = () => {
    if (counter < slides.length - 1) {
    counter++;
    slideImage();
    }
    };
    const goPrev = () => {
    if (counter != 0) {
    counter--;
    slideImage();
    }
    };

    • @Himanshua09
      @Himanshua09 Год назад

      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

    • @CodeWithMaahzaib1
      @CodeWithMaahzaib1 8 месяцев назад

      Yeh tw Galat code hai try kia but hua he nahi😊

    • @geeksrahul
      @geeksrahul 7 месяцев назад +2

      @@Himanshua09 make sure you used querySelectorAll() not querySelector()

  • @adeebkhan8531
    @adeebkhan8531 Год назад +27

    Following changes must be done in 'goPrev' and 'goNext' functions to fix this BUG:
    const goPrev = () => {
    if (counter == 0) {
    counter = slides.length - 1;
    slideShow();
    } else {
    counter--;
    slideShow();
    }
    }
    const goNext = () => {
    if (counter == slides.length - 1) {
    counter = 0;
    slideShow();
    } else {
    counter++;
    slideShow();
    }
    }

    • @saquibansari7866
      @saquibansari7866 Год назад

      Thanx buddy

    • @Himanshua09
      @Himanshua09 Год назад

      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

    • @zaryabimran7303
      @zaryabimran7303 Год назад

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

    • @thesocialtok
      @thesocialtok Год назад

      use array from() method to fix this foEeach loop error@@Himanshua09

    • @MajorInflation
      @MajorInflation Год назад

      OKAY I HAVE BEEN TRYING TO RECREATE THIS WITH A DIFFERENT FUNCTION AND IT DID NOT WORK I AM LOSING MY MINF BUT THANKS FOR THIS CODE I AM SO DAMN GRATEFUL BECAUSE I HAVE A WEBSITE TO MAKE AND SUBMIT IN 5 DAYS FOR A PROJECT AND I HAVE BEEN STUCK AT MAKING THIS CARSOUEL FOR 2 DAYS BECAUSE MY JAVA SCRIPT IS BAD HOWEVER I KNOW THAT YOU DON'T CARE SO THANKS THANKS THANKS THANKS THANKS ALSO THANKS TO THE VIDEO MAKER GUY FOR THE OG CODE CUZ I DON'T KNOW JS THAT WELL AND UR EXPLAINATION WAS GREAT OKAY IM RUNNING OUTTA TIME BY THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS

  • @MuhammadWaqas-eb1uu
    @MuhammadWaqas-eb1uu 8 месяцев назад +2

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

  • @SurajMule-i8o
    @SurajMule-i8o 6 месяцев назад

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

  • @OneXHacker001
    @OneXHacker001 Год назад

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

  • @krishnaghosh8393
    @krishnaghosh8393 2 года назад +5

    This is a very very helpful video
    Thanks for sharing

  • @Sunny-cx8ki
    @Sunny-cx8ki 4 месяца назад

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

  • @Rahmanullah-iu9tf
    @Rahmanullah-iu9tf Год назад +2

    sir this is very helpful

  • @hammadrehmani2666
    @hammadrehmani2666 2 года назад +3

    great job brother...its very helpful for me

  • @VishalSharma-rn7mt
    @VishalSharma-rn7mt 11 месяцев назад

    Awesome, very clear and easy

  • @AnonymousMaiden
    @AnonymousMaiden 2 месяца назад

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

  • @amir8reza536
    @amir8reza536 4 месяца назад

    Thank you for this video 🙏🏻

  • @omprakashsuthar7218
    @omprakashsuthar7218 Год назад +1

    This is a very helpful video.
    Thanks sir

  • @harisrehman7090
    @harisrehman7090 Год назад +2

    REALLY HELPFULL THANKU!❣

  • @Chain25
    @Chain25 Год назад

    Welcome and Thanks a Lot.

  • @shivam3839
    @shivam3839 Год назад

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

    • @Himanshua09
      @Himanshua09 Год назад

      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

    • @shivam3839
      @shivam3839 Год назад

      @@Himanshua09
      const slides=document.querySelectorAll('.slide')
      let counter=0
      slides.forEach((slide,index)=>{
      slide.style.left=`${index*100}%`
      })
      const slideImage=()=>{
      slides.forEach((slide)=>{
      slide.style.transform=`translateX(-${counter*100}%)`
      })
      }
      const goNext=()=>{
      counter++
      if(counter>3)
      counter=3
      slideImage()
      }
      const goPrev=()=>{
      counter--
      if(counter

    • @zaryabimran7303
      @zaryabimran7303 Год назад

      @@Himanshua09 console and check that have you selected all the slides in the slide variable ...

    • @pankaj_9998
      @pankaj_9998 Год назад

      @@Himanshua09 check slides is array of images items or not.

  • @NANIANTIC
    @NANIANTIC 7 месяцев назад +1

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

  • @Shahid-zt7mg
    @Shahid-zt7mg 2 года назад +1

    This is really very very very helpful for me using this concept I make better the my UI

  • @gaurangmore9413
    @gaurangmore9413 2 года назад +2

    thanks a lot buddy,this video really saved my ass.

  • @MienVuThi-uf9hf
    @MienVuThi-uf9hf Год назад +2

    great video

  • @akhilch3684
    @akhilch3684 2 года назад +1

    Wow great explanation

    • @Himanshua09
      @Himanshua09 Год назад

      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

  • @fightforfitness2256
    @fightforfitness2256 Год назад

    Very nicely explained sir.

  • @harikyt
    @harikyt Год назад

    awesome...bohot sahi

  • @sumitgupta7419
    @sumitgupta7419 Год назад +3

    Thanks sir please keep making video and explaining everything very neatly step by step

  • @samandartursunov7205
    @samandartursunov7205 10 месяцев назад +1

    Thanks bro )

  • @crazytthings47
    @crazytthings47 Год назад +9

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

  • @talibhusain3335
    @talibhusain3335 2 года назад +1

    Nice explanation

  • @jokieme1184
    @jokieme1184 2 года назад +6

    Sir please make a video on responsive nav bar

  • @yashghugardare519
    @yashghugardare519 Год назад +1

    very helpfull

  • @advanbhatti6063
    @advanbhatti6063 2 года назад +1

    Big fan

  • @kinzasheikh-xn9oe
    @kinzasheikh-xn9oe 10 месяцев назад +3

    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}%)`
    }
    )
    }

  • @imihere5103
    @imihere5103 2 года назад +3

    Sir me ne fiverr pe six months pehly account bnaya tha, kisi waja se kam start na kr ska, WordPress se related gigs bnai thi
    Now i want to start freelancing again because im free now
    Pochna just ye he k muje new account bnana chahye ya wohi purana account
    Agr wohi account use kru to kya customer ko ye ni lge ga k is ne to six months se ak b order complete ni kya, customer negative ni ho jay ga? Pls guide me

    • @abhishektiwari2643
      @abhishektiwari2643 2 года назад +2

      Freelancing me kya karna hota hai
      Kya programing language aana chahiye
      Esme kya karna hota hai
      Kya kya aana chahiye

  • @randykeetley9780
    @randykeetley9780 Год назад +1

    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

    • @hassansmma
      @hassansmma Год назад

      check again with zoom

    • @Poojayadav_11-m9c
      @Poojayadav_11-m9c Год назад +1

      Yes even I got this issue, images doesn't change after clicking next and prev

    • @Vikrant_Dubey
      @Vikrant_Dubey Год назад +1

      slide.style.transform = `translateX(-${counter * 100}%)`; may be in this line you are using single quotes use tilde copy paste this code line

    • @anjalimishra455
      @anjalimishra455 Год назад

      ​@@Vikrant_DubeyI ha have same issue 😔 Maine check Kiya to console me error hai goNext is not defined at HTMLbuttonElement.onclick aa raha hai please help 😢

    • @Lyrics_Editz2005
      @Lyrics_Editz2005 7 месяцев назад

      I also

  • @nehaartgallery6319
    @nehaartgallery6319 6 месяцев назад

    What level of project should we done for internship

  • @_justacoder_
    @_justacoder_ Год назад +1

    Loved it!! you made it super easy to understand

  • @abhinavyadav6821
    @abhinavyadav6821 2 года назад +5

    Sir pls make video on ping pong game by javascript , pleaseee sir it will be very helpful

  • @Dev-Phantom
    @Dev-Phantom 2 года назад +1

    easy to understand

    • @zaryabimran7303
      @zaryabimran7303 Год назад

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

  • @manishpanchal1098
    @manishpanchal1098 2 года назад +1

    nice video

  • @skygrace8459
    @skygrace8459 2 года назад +1

    Excellent, thank sir.
    Would you please make autoplay list

  • @LizanSarkar-e5e
    @LizanSarkar-e5e Месяц назад

    good work help to me.

  • @nikitashirke6025
    @nikitashirke6025 2 года назад

    Superb

  • @lyrichives7859
    @lyrichives7859 Год назад

    Thank youuu

  • @026maheshkumars7
    @026maheshkumars7 Год назад

    super

  • @Ranaali069
    @Ranaali069 5 месяцев назад

    nice

  • @nishagawade3248
    @nishagawade3248 Год назад +2

    why do we need to write slide image function twice?

    • @avishekadhikary3677
      @avishekadhikary3677 Год назад

      Coz first we have to arrange the images in a systematic way, in a line. Then we have to slide those images on that line of images.
      In these case the first slide function arranges the images and the second one is the function for the slider
      Hope these helps 🙂✊

    • @Himanshua09
      @Himanshua09 Год назад

      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

  • @mahadevmushrooms
    @mahadevmushrooms Год назад +2

    mere hisab se bright theme better hai

  • @visheshkumar8015
    @visheshkumar8015 2 года назад +4

    Can use this for the first the slide after last slide
    translateX(-${(counter%4)*100}%)

  • @ashutoshswain6206
    @ashutoshswain6206 Год назад +3

    Dear sir, Thanks for this type of video but please provide it's source code

  • @mystudy6114
    @mystudy6114 2 года назад +1

    Please make a separate playlist for this

  • @peculiar_psa
    @peculiar_psa 7 месяцев назад

    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!

  • @hello_Subham
    @hello_Subham Год назад +1

    please send us logic that empty box which is not found in the github link I really need that code ..

  • @nitishkumar4633
    @nitishkumar4633 Год назад +1

    Sir where this code is available, may you please provide the link?

  • @zaryabimran7303
    @zaryabimran7303 Год назад +1

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

  • @integrate2945
    @integrate2945 Год назад +1

    Could you please provide some php project????? Please....

  • @kholoudbelhadj
    @kholoudbelhadj Год назад

    how can I make them switch automatically

  • @chunmunjain3490
    @chunmunjain3490 2 года назад +1

    my javascript code is not working plz share the code

  • @manojrawat5756
    @manojrawat5756 Год назад +1

    ❤❤❤

  • @avinashhemanth4145
    @avinashhemanth4145 Год назад +1

    in script code why this is not working for me
    slides.forEach(
    (slide,index) =>{
    slide.style.left=`$(index*100)%`
    }
    )

    • @brijeshpoojary1791
      @brijeshpoojary1791 Год назад

      It's brackets should be changed to
      ${index*100}%

    • @avinashhemanth4145
      @avinashhemanth4145 Год назад

      @@brijeshpoojary1791 kk thnks

    • @saquibansari7866
      @saquibansari7866 Год назад

      After dollar sign use curly braces {}, not parenthesise (), while using template literal...

  • @Irshadali121-ng6rr
    @Irshadali121-ng6rr Год назад +1

    Slide end kaise hoga

  • @RamChander-ng1de
    @RamChander-ng1de 2 года назад

    Sir kon s theam use karte hoo in vs code

  • @beinglearner8543
    @beinglearner8543 8 месяцев назад

    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

  • @BRAND_OF_UTTARPRADESH
    @BRAND_OF_UTTARPRADESH Год назад

    Please avoid text display on screen at code editor page

  • @digitalaayam2503
    @digitalaayam2503 2 года назад

    Ye example to automatically chalta hai bro, however, good job

  • @Arbazbabu033
    @Arbazbabu033 10 месяцев назад

    Jquery se slick skider kese lagaye

  • @parthdashore46
    @parthdashore46 2 года назад

    clean

  • @TusharKumarPatel-ns1lo
    @TusharKumarPatel-ns1lo Год назад

    I tried it as it is but not working

  • @MrJayantchaudhary
    @MrJayantchaudhary 2 года назад

    Sir can you please make it infinite.that after last image first image will run.

  • @Lyrics_Editz2005
    @Lyrics_Editz2005 7 месяцев назад

    Sir iska source code kha Mila ga

  • @vasudevpareek2862
    @vasudevpareek2862 Год назад

    the code is not working 😕

    • @harikyt
      @harikyt Год назад +1

      it is working for me

  • @Lets_develop_it
    @Lets_develop_it Год назад

    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()
    }
    }

    • @scriptpriest
      @scriptpriest Год назад +1

      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

  • @banihin
    @banihin Год назад

    I cannot use .style.left or .style.transform. There seems to be an error with the "slide" variable but I've followed every step.

  • @phpmysql2518
    @phpmysql2518 2 года назад +1

    where is your github link

  • @rajputfitness8641
    @rajputfitness8641 Год назад +1

    how to make this auto change😅

  • @_justacoder_
    @_justacoder_ Год назад

    where is the link for source code

  • @alilatif2467
    @alilatif2467 2 года назад

    ❤️❤️❤️❤️

  • @nabilaakhtar818
    @nabilaakhtar818 Год назад

    Where is the github link?

  • @gkandcurrentaffairs7151
    @gkandcurrentaffairs7151 Год назад

    if you provide source code then it will easy bro

  • @mdirshadkhan6124
    @mdirshadkhan6124 2 года назад +1

    Can you share code of this image slider

    • @MUHAMMADUMAR-fe7ec
      @MUHAMMADUMAR-fe7ec 2 года назад +1

      ye tatto hai nai kare ga

    • @bollybuck
      @bollybuck 2 года назад

      @@MUHAMMADUMAR-fe7ec yr img slider ki koi range hi ni h
      Back krty rho hota rhy ga

    • @MaanIsMe
      @MaanIsMe 2 года назад +1

      Here you go,
      const goNext = () => {
      if (counter < slides.length - 1) {
      counter++;
      slideImage();
      }
      };
      const goPrev = () => {
      if (counter != 0) {
      counter--;
      slideImage();
      }
      };

  • @ManmohanBhardwaj-ft2hu
    @ManmohanBhardwaj-ft2hu Год назад

    Sir code not working

  • @Rameshpuri81
    @Rameshpuri81 Год назад

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

  • @scriptpriest
    @scriptpriest Год назад

    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

    • @pankaj_9998
      @pankaj_9998 Год назад

      i was also looking solution for this case

    • @its_adesh
      @its_adesh Год назад

      Use modulo on counter

  • @advanbhatti6063
    @advanbhatti6063 2 года назад

    Sir g me ne like subscribe or share kr ke apni fee pay krdi hy

  • @priyamittal8302
    @priyamittal8302 8 месяцев назад

    source code?

  • @Devyadav0007
    @Devyadav0007 8 месяцев назад

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

  • @bhumikasethi7175
    @bhumikasethi7175 5 месяцев назад

    Not working

    • @zohaibjazz2828
      @zohaibjazz2828 12 дней назад

      You mismatched the code. You must have written wrong code otherwise the code works well.

  • @Himanshua09
    @Himanshua09 Год назад

    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

    • @kumaxFPS
      @kumaxFPS Год назад

      check in console, u may not be assigning the images in slides variable.

    • @kumaxFPS
      @kumaxFPS Год назад

      alos check JS connection

  • @aarushirajput7821
    @aarushirajput7821 Год назад

    translate spelling mistake😅

  • @rb.rana1993
    @rb.rana1993 2 года назад +1

    Sir please give this projector source code or GitHub link

  • @MuntasirMamunRony
    @MuntasirMamunRony 5 месяцев назад

    sir pehle haddi to banalo fir style lagana!

  • @nistaff9319
    @nistaff9319 3 месяца назад

    it doesn't work thank you for wasting my time

  • @itskishorstatus962
    @itskishorstatus962 Год назад +1

    Sir can you please make it infinite.that after last image first image will run.

  • @manishagurjar9058
    @manishagurjar9058 Год назад +1

    my javascript code is not working plz share the code.