Best example ever - short, simply without unnecessary talk - just perfect
@alifazib9124 Жыл бұрын
Hi, thanks for showing us on how to apply these effects using javascript. Just to add something to your coding if you wanted to make the gallery "automatically scroll" to the next 3 images, you can try adding conditional and comparing your "evt.deltaY" whether it receives "negative value (left scroll)" or "positive value (right scroll)"; scrollCont.addEventListener("wheel", (evt) => { scrollCont.style.scrollBehavior = 'smooth'; evt.preventDefault(); if(evt.deltaY < 0) { scrollCont.scrollLeft = (Math.floor(scrollCont.scrollLeft/900)*900)-900; } else if (evt.deltaY > 0) { scrollCont.scrollLeft = (Math.floor(scrollCont.scrollLeft/900)*900) + 900; } }); nextBtn.addEventListener("click", () => { scrollCont.style.scrollBehavior = 'smooth'; scrollCont.scrollLeft += 900; }); backBtn.addEventListener("click", () => { scrollCont.style.scrollBehavior = 'smooth'; scrollCont.scrollLeft -= 900; }); ________________________________________________________________________ // ofcourse if you wanted to make the "scrolling effect" to maintain its position, its possible but the bug is when you scroll and the position remains in between the interval of 0-900, the back/next button doesnt automate to the perfect position of the previous/next 3 images. So in order to rectify this, you can add conditional for both nextBtn and backBtn's "click" event listener: scrollCont.addEventListener("wheel", (evt) => { scrollCont.style.scrollBehavior = 'smooth'; evt.preventDefault(); scrollCont.scrollLeft += evt.deltaY; }); nextBtn.addEventListener("click", () => { scrollCont.style.scrollBehavior = 'smooth'; scrollCont.scrollLeft += 900; if (scrollCont.scrollLeft % 900 !== 0) { scrollCont.scrollLeft = (Math.floor(scrollCont.scrollLeft/900)*900) + 900; } }); backBtn.addEventListener("click", () => { scrollCont.style.scrollBehavior = 'smooth'; scrollCont.scrollLeft -= 900; if (scrollCont.scrollLeft % 900 !== 0) { scrollCont.scrollLeft = (Math.floor(scrollCont.scrollLeft/900 )*900); } }); //what it does is that it reads the remainder if the button you click will have any remain values after divided with 900. If it does, it will automate to the perfect position of the previous/next 3 images. Hope this helps!
@bharatkhatwani40405 ай бұрын
can you give source code it is not render in my case!
@lunalyrics77486 ай бұрын
omagashhh, u saved my lifeeeeee. since last night im looking for image slides that will use css, html, and js, but watching and doing those video won't work on my project, but this video it worked and so easy to follow!!! thank you so muchhhh.❤❤❤
@ajitganjave883711 ай бұрын
- [00:00] 🖱 Create a horizontal image gallery in JavaScript with mouse wheel scrolling. - [00:29] 🌈 Add control icons (back and forward) for manual scrolling within the gallery. - [00:56] 🖼 Implement an effect where images become colorful and larger on hover. - [01:52] 🧩 Use HTML, CSS, and simple JavaScript for this JavaScript mini project. - [03:28] 🖼 Customize gallery content by adding images within a grid layout. - [04:09] 📏 Enable horizontal scrolling within the gallery and hide the scroll bar. - [05:20] 🖱 Center control icons vertically and horizontally within the gallery. - [06:44] 🖱 Implement hover effects on images, changing grayscale and size. - [07:57] 🔄 Enable smooth horizontal scrolling with the mouse wheel. - [09:39] 📏 Implement smooth scrolling animation when clicking on control icons. - [11:10] 🎉 Create a smooth and interactive horizontal image gallery using HTML, CSS, and JavaScript.77s
@bluefish133 Жыл бұрын
The only real issue I had after watching this video was that my JavaScript didn't work. Otherwise, simple and awesome!
@bilalbeny4172 Жыл бұрын
what I can say is thank you so much for your videos, you are a great teacher. 🤩🤩🤩
@cheaptuber6418 ай бұрын
The most simple and easy code for slider on the whole yt love you brother
@JAY_LAURENCE Жыл бұрын
Thank you I love JAVASCRIPT!!!!
@ytarun07 Жыл бұрын
I don't Know Js From Where I could Learn Js
@uryuishida3527 Жыл бұрын
Guys if you find ur js script dont work, juts replace all the (container) in ScrollContainer. Replace the Container with Bar, like this Scrollbar. Thats all
@Islamicheart786Atitude Жыл бұрын
Show the code
@Shinymidnightxb8 ай бұрын
Thanks it helped me alot 😊❤
@UmaSahni.Ай бұрын
Your explanation is Awesome ! But it will be great if you would have made it responsive too.
@GreatStackDev29 күн бұрын
Thank you so much. Will try from next project.
@SeanOduor5 ай бұрын
hey @greatstack, this tutorial man, I am just glad we have people like you..I was so pissed with my initial build then i came across this tutorial.Long story short, I am now happy with my project
@GreatStackDev5 ай бұрын
Glad you liked it. Thanks for your comment. 😊
@okayne35349 ай бұрын
Thank you, it's really the best example of the slider
@ayesha15799 ай бұрын
Finally find a best video 👍
@seeker379411 ай бұрын
Please make the same video , but this time add blurry background color or opacity to button when we reach the right-end or left-end, for a better user experience.... Thanks a lot great and easy to follow tutorial.
@Vyapariefx8 ай бұрын
First of all Thank you ❤ Please Can you explain slowly because i an new learner i don't know the proper script here you used i am didn't getting point and Logic.
@rachitdhaundiyal70119 ай бұрын
It helped me a lot , if i want to open a description on the down section by clicking any particular image on this image gallery.... How can we do that?
@S.M.Saim_HossainАй бұрын
Thanks..
@GreatStackDev29 күн бұрын
You're welcome. 😊 Keep coding.
@azerdunyamaliyev8962 Жыл бұрын
Thank you very much :D
@petermwansa489010 ай бұрын
Thank you
@timetolaugh4906 Жыл бұрын
Thank you sooo much 😊, your video helped me alot. Thanks again 😊
@RahulSharma-we1bo4 ай бұрын
Thanks bro, it helped a lot
@SabirDk09 Жыл бұрын
This is very helpful sir❤❤❤
@LuisMedina-dk3vc11 ай бұрын
Awesome!! Thank you so much.
@suhasgardare4833 Жыл бұрын
Thank you sir... ❤❤
@SumanSingh-u3f5o Жыл бұрын
Very Helpful
@esararsaikh9711 Жыл бұрын
Well explained sir😇😇
@mohammadmeraj405 ай бұрын
Thanks bro❤❤❤
@GreatStackDev5 ай бұрын
Glad you liked it. Thanks for your comment. 😊
@jaydeeppatil7936 Жыл бұрын
Can you please make a video on all event listeners that are useful for these type of mini projects
@hemahemnani32152 ай бұрын
Well done
@positiveAddiction1 Жыл бұрын
As always 100% on point 👌
@torr59525 ай бұрын
Very cool!
@benhafsailhem6930 Жыл бұрын
Thanks for share it works very well
@dolittlediehard16705 ай бұрын
I really like it yes but I would like it more if it auto scrolled with no mouse action say every 5 seconds from left to right and loop indefinitely unless i take control by hovering over them with the mouse.
@OnaySchool-lc6lf10 ай бұрын
Great👍👍👍
@rahulshendre70894 ай бұрын
thanks a lot man
@captainbr0st.189 Жыл бұрын
Hats off to you
@biaroxy21657 ай бұрын
Era disso que estaba precisando. Muchas gracias
@nearpeela2 ай бұрын
Thank YOu
@easyprogramminglessons2943 Жыл бұрын
Sir, I found this tutorial useful. Thanks!
@Assassin5223 күн бұрын
Smooth Scrolls behavior is not working for me can anyone help me
@TerryLoughran Жыл бұрын
Awesome
@mrlonelytvoffornna_fine7913 Жыл бұрын
Great job
@amitchaudhary37608 ай бұрын
hey tellme one thing if we use css scroll bar then why we need write js because withouth this wheel function it also working fine
@rao11994 ай бұрын
Super
@venkatchalam6385 Жыл бұрын
Nice sir ,
@АнтонГригорьевич-ф3з Жыл бұрын
Simple and cool ! Thanks for helpful video.
@litunkhan4309 Жыл бұрын
use 9 image the you will see its not working
@rohitparmar7538 Жыл бұрын
Hi There, Thanks for this amazing tutorial! Can you please tell me the reason of placing img tag inside span tag and how it is helpful ?
@harshitrohilla10556 күн бұрын
I have tried it but the problem with this approach is that the scrolling is very gittery and in my case it was scrolling vey less in horizontal direction with the gitters and yes i also tried smooth scrolling
@pumpkinpie4881 Жыл бұрын
And how can I make this responsive in mobile device If I use absolute values for the width of container just like you? Maybe change the grid column template?
@aestheticpostsonly Жыл бұрын
Hey. I had a question. Could you please tell me how to upload an image in a website and then display the uploaded image in a separate website? Would be really helpful, Thank you
@magma-SKYROCKSTARTRADE Жыл бұрын
Hi, you can upload the image to your website and then to twitter or google drive; but in order for you to upload it to a different site; you would have to have permission from the website's administrator to upload your image into "their" website. -Maybe this helps.
@SaiSanchithBagunji10 ай бұрын
Does anyone know if I can use a boxicon font in the instead of an image
@samiulislamsourov3299 Жыл бұрын
Sir, please create a slider without using swiper js.... please create a slider using html,css and JavaScript. Please don't use any plugin. Please sir, please 🙏
@ProgrammingTT Жыл бұрын
I make projects using HTML, CSS and JavaScript (with code, for beginners).💻
@pozhilanvicky12438 ай бұрын
Bro it was amazingly working in laptop but in mobile version images are too small i convert png to jpg format also buf no changes give me some tips bro i am the begginer
@danteeep7 ай бұрын
Same problem for me its not mobile friendly looking for a solution
@pozhilanvicky12437 ай бұрын
@@danteeep I find the solution bro you add in css @media (max-width:1100px) and add height and width according to your need you jest check it with inspect in mobile view it was working if you have issue means again comment here I will guide you
@danteeep7 ай бұрын
@@pozhilanvicky1243 sorry man used another image slider and that one had bugs as well but i fixed some of them
@pozhilanvicky12437 ай бұрын
@@danteeep ok bro 👍
@TheNazmul277 ай бұрын
I am a member of your channel. How get the code of this slide?
@Niseres Жыл бұрын
hello, please can you make the gallery scroll and show a single image at a time in mobile mode?
@aresmobiliario.oficial Жыл бұрын
Friend, a question How can I add more images? It only allows me to add 6 When I add more images it deforms
@guru-xn9yp Жыл бұрын
Nice! is this gonna be responsive and working on phones?
@danteeep7 ай бұрын
No
@Vector_gnАй бұрын
Genial
@svdden_strike8 ай бұрын
How can I make it auto slide
@АнтонГригорьевич-ф3з Жыл бұрын
I like the visual theme of your code editor, very eye-catching, what’s the name?
@igorkuzniarski3627 Жыл бұрын
Visual studios
@stefancomandant8683 Жыл бұрын
Visual Studio Code
@SaadAbdulaziz-sk6cz6 ай бұрын
❤
@marmol3456 Жыл бұрын
Hey, brother, can you make Anime websites?
@FrancescoCeleberrimo5 ай бұрын
I have 6 images like your example, but i don't know why my third image It's not fully visible, and I have to press the right arrow to see it
@lalankumar67868 ай бұрын
How to give heading on top of slider
@tornadomalviya1401Ай бұрын
Thank you u r indian right ?
@wrightgichana85324 ай бұрын
i Added scroll behavior part but mine didnt have a smooth scroll animation like yours
@ugwokaanthony713 Жыл бұрын
I wrote an investment template using html, css and js but I don't know how to connect the admin so that it controls the user interface
@bijaynepali29566 ай бұрын
hey bro create footy tic tac toe please
@realnatureloveradda18118 ай бұрын
Sir my scrollBehavior ="smooth" is not working Please reply
@starkeditor99352 ай бұрын
Nothing I understand with the css code
@petiteflamby Жыл бұрын
Hi, thank you ! I was trying it but the back btn was not working because I written : "scrollContainer.scrollLeft += 900" instead of -900 hahaha
@collinsomonievusa5203 Жыл бұрын
1)i don't know but this code ain't working for me, perhaps the source code can help but for some reason it's no where to be found... 2) The prevent default is not preventing the default scroll behaivour don't know why
@magdalenam3717 Жыл бұрын
Hello. In my case, don't work 'deltaY' and 'scrollBehavior'. Why? If anyone knows the answer, it would mean a lot to me. Thank you.
@kushagraawasthi07 Жыл бұрын
I also got the same problem. If you have resolved it Kindly help.
@saisaketh8433 Жыл бұрын
it should be deltaX.
@RajnandiniPatel-f7b Жыл бұрын
thanks but I want to scroll down, what should I do
@chefernandez563 Жыл бұрын
Guys if your scroll behaviour isnt working its cause it should be behavior amrican eng
@benjicanones1454 Жыл бұрын
When I external the JS, the side-scrollbar does not behave as internal JS.
@slow_and_reverb_songs_94 ай бұрын
bhai same slider ho lakin ek baar me ek hi image right ya left ho.
@indian-shorts9215 Жыл бұрын
hi can you please help me with the scroll bahvciour on click its not working
@jobaer23. Жыл бұрын
Dark theme i use after watching one of your videos. But if I refresh the page, it comes back to the previous theme. What is the solution?
@anujchauhan7403 Жыл бұрын
May be localstorage is the solution
@danteeep7 ай бұрын
Its not mobile responsive for me. Need adjustments
@manidynamic5227 Жыл бұрын
Can you tell me how to make free png images ???
@devinbrown89285 ай бұрын
the buttons are not working for me
@PaulLep550 Жыл бұрын
is it responsive?? damn why guyz never give media query
@litunkhan4309 Жыл бұрын
plx solve this if i use 9 image 0r 12 its just work 6 image not 9 or 12
@mdabdulahallnomantuhin36218 ай бұрын
thanks bro
@cameronfletcher6506 Жыл бұрын
I cant get my buttons to work can anyone help
@shodya1201 Жыл бұрын
How can I do this without wheel scroll?
@danteeep7 ай бұрын
Take off wheel scroll function
@briankay427 Жыл бұрын
this javascript failed to work in my external file
@Rafay-th2yo6 ай бұрын
sir please provide source code.
@tahashahid4186 Жыл бұрын
bro my JS in not working if someone find the solution plz tell me PLZ
@veertumpadhechalo16 күн бұрын
That's what I don't like... Just saying what to do without explaining why... This code works because size of pics is same and proportional to div size...
@wahidniazbig237911 күн бұрын
I try all of this code step by step and it didn't work 😐😐😐
@samiulislamsourov3299 Жыл бұрын
Sir i tried many time...but scrollBehavior doesn't work. Why it doesn't work?
@@GreatStackDev thanks for your reply sir... I'm trying many time...but it doesn't work..
@GreatStackDev Жыл бұрын
please check the browser console for any JS error
@twoonswig3667 Жыл бұрын
For some reason scrolling right/forward isn't working in my code, anyone else found this problem?/know how it might be helped?
@adelinahs3870 Жыл бұрын
I can't make it work either
@collinsomonievusa5203 Жыл бұрын
me too it ain't working
@litunkhan4309 Жыл бұрын
if i used nine image it just show just six baki sab nahi ata hai click karne ke bat vi
@chefernandez563 Жыл бұрын
The java script disnt work at all intwrnal and external
@chefernandez563 Жыл бұрын
Fixed it by just refreshing the server again
@Kim-d2u9 ай бұрын
8.Feb.24
@chathura512 Жыл бұрын
where is source code file? even i subscribed this
@collinsomonievusa5203 Жыл бұрын
i was looking for that too
@Belladona-yj7if7 ай бұрын
why is my button not working even though i wrote the same code as him? let scrollContainer = document.querySelector(".gallery"); let previousBtn = document.getElementById("previous-btn"); let nextBtn = document.getElementById("next-btn"); scrollContainer.addEventListener("wheel", (evt) => { evt.preventDefault(); scrollContainer.scrollLeft += evt.deltaY; scrollContainer.style.scrollBehavior = "smooth"; }); nextBtn.addEventListener("click", () => { scrollContainer.style.scrollBehavior = "smooth"; scrollContainer.scrollLeft += 900; }); previousBtn.addEventListener("click", () => { // Subtracting so that the image goes to the right instead of the left scrollContainer.style.scrollBehavior = "smooth"; scrollContainer.scrollLeft -= 900; });