Home > Enterprise >  How to make horizontal scroll which scrolls by clicking button? Django template
How to make horizontal scroll which scrolls by clicking button? Django template

Time:03-21

I am doing ecommerce website in django.I wanted to implement horizontal scroll of products in my website.But, I do not have any idea about this. Can someone give me an idea about how to do this? enter image description here

For example, if the right button clicked, I want to show another product and remove first product in this list(like scrolling). However, I do not have any ideas? So, can you help me?

CodePudding user response:

Check bootstrap-carousel making slider for your product items:

https://getbootstrap.com/docs/5.1/components/carousel/

CodePudding user response:

I think you should make arrows in each directions between the red button to make this more convenient for the user. Next, you should determine if you want to have an database of products behind your website to be able to manage your stock. You could make an id for each of your products and incrementing or decrementing it on the click of the button then change the product based on that id. In general an database is more useful for shopping websites. Another option is to make an simple carrousel to change the displayed product with bootstrap (https://getbootstrap.com/docs/4.0/components/carousel/) or by hand if you want.

  • Related