If you’ve downloaded the plugin nodebb-plugin-recent-cards
and are struggling with getting the slider to work on a mobile device in the way that it’s supposed to (swipe), there is a (relatively) simple fix.
First, add the below to ACP -> Appearance -> Custom Header
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/bxslider/4.2.12/jquery.bxslider.min.js"></script>
Then, add the below JS snippet to your ACP -> Appearance -> Custom JS
$(window).on('action:ajaxify.end', function(data) {
$('.carousel-mode').bxSlider();
});
This provides the real slider functionality you are looking for Admittedly, it’s pulling in another library, but it’s tiny and unlikely to have any real impact (unless the source is offline of course).
And, with a bit of imagination, plus assistance from the documentation available from
https://bxslider.com/options/
It’s possible to create (in conjunction with https://sudonix.com/topic/256/recent-cards-plugin-customization/2) this effect (automatic scrolling through categories) using the below code
$(window).on('action:ajaxify.end', function(data) {
$('.carousel-mode').bxSlider({
auto: true,
autoControls: true,
stopAutoOnClick: true,
pager: false
});
});
Enjoy