We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

how to change multicolumn slider numbers in mobile to a slider bar?

how to change multicolumn slider numbers in mobile to a slider bar?

mniciarz
Visitor
2 0 2

hi there, im interested in changing the multicolumn slider which is currently arrows and numbers to a slider bar. can anyone provide me with the code to do this please!

 

looking to add something like this:

IMG_5192.jpg

Replies 4 (4)

Shadab_dev
Shopify Partner
1583 83 173

Okay so this will just show progress or number of slides that the user has viewed, right?? 

 

So you already know that this will involve code which is a good thing. Haven't implemented this yet but love to give it a try.

 

Please reach out via personal links below for a convenient conversation and collaboration.

 

Best

Shadab

Buy me Coffee, if you feel i was helpful. Email Me here or WhatsApp me with this link for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.

Made4uo-Ribe
Shopify Partner
10211 2427 3079

Hi @mniciarz 

This is doable but requires custom code to add the bar in a multicolumn layout. You will need a developer for this.

Here are some examples.

Made4uoRibe_0-1734446608662.png

Let us know of your interested. Thanks!

 

 

 

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
mniciarz
Visitor
2 0 2

Hi yes I am interested can you provide the code needed to add this feature? I can add it to my multicolumn.liquid or wherever. 

yktr280
Shopify Partner
1 0 0

The code below is what I have tried and succeeded with in the featured-collection.liquid. I hope you find it helpful!

 

<div class="progress-bar-container">
<div class="progress-bar"></div>
</div>
<style>
.progress-bar-container {
position: relative;
width:100%;
height: 1px;
background-color: #CFCFCF;
margin-top: 10px;
overflow: hidden;
}

.progress-bar {
width: 100px;
height: 1px;
background-color: #000;
position: absolute;
left: 0;
transition: transform 0.3s ease-out;
display: block !important;
}
</style>
<script>
$(document).ready(function () {
let slider = $("#Slider-{{ section.id }}");
let slides = slider.find(".slider__slide");
let totalSlides = slides.length;
let progressBar = $(".progress-bar");

slider.on("scroll", function () {
let scrollLeft = slider.scrollLeft();
let maxScroll = slider[0].scrollWidth - slider.outerWidth();
let progress = (scrollLeft / maxScroll) * 100;

let maxMove = $(".progress-bar-container").width() - progressBar.width();
let moveX = (progress / 100) * maxMove;

progressBar.css("transform", `translateX(${moveX}px)`);
});
});
</script>