Skip to content

Recent Cards - fix for slider on mobile not working

Customisation
23 3 10.3k 1
  • @crazycells If you can’t find it, this will resolve it

    li.col-md-3.col-sm-6.col-xs-12.recent-card-container {
        width: 290px !important;
    }
    
    wrote on last edited by
    #8

    @phenomlab said in Recent Cards - fix for slider on mobile not working:

    @crazycells If you can’t find it, this will resolve it

    li.col-md-3.col-sm-6.col-xs-12.recent-card-container {
        width: 290px !important;
    }
    

    I could not find any CSS codes related to the width of these cards, but this code solved the problem. Thanks.

    Additionally, why the pages are shown as points under these cards? We do not normally have that setting on, I checked the settings and restarted the forum, but they did not go away.

  • @phenomlab said in Recent Cards - fix for slider on mobile not working:

    @crazycells If you can’t find it, this will resolve it

    li.col-md-3.col-sm-6.col-xs-12.recent-card-container {
        width: 290px !important;
    }
    

    I could not find any CSS codes related to the width of these cards, but this code solved the problem. Thanks.

    Additionally, why the pages are shown as points under these cards? We do not normally have that setting on, I checked the settings and restarted the forum, but they did not go away.

    wrote on last edited by
    #9

    @crazycells Because you are overriding the plugin bxslider library with one from an external source - see below

    $(window).on('action:ajaxify.end', function(data) {
        $('.carousel-mode').bxSlider({
            auto: true,
            autoControls: true,
            stopAutoOnClick: true,
            pager: false
        });
    });
    

    Essentially, you’ll need to use pager: false as shown above to disable it

  • @crazycells Because you are overriding the plugin bxslider library with one from an external source - see below

    $(window).on('action:ajaxify.end', function(data) {
        $('.carousel-mode').bxSlider({
            auto: true,
            autoControls: true,
            stopAutoOnClick: true,
            pager: false
        });
    });
    

    Essentially, you’ll need to use pager: false as shown above to disable it

    wrote on last edited by
    #10

    @phenomlab to stop automatic movement, I should do:

    auto: false,
    

    right?

  • @phenomlab to stop automatic movement, I should do:

    auto: false,
    

    right?

    wrote on last edited by
    #11

    @crazycells Yes, or just remove it

    0ef15f46-5d7d-4527-9ffb-f7c47ac72757-image.png

  • @crazycells Yes, or just remove it

    0ef15f46-5d7d-4527-9ffb-f7c47ac72757-image.png

    wrote on last edited by
    #12

    @phenomlab yeap, I see it now. Thank you very much. 🙏

    In Firefox (desktop), and in safari (mobile) I do not have any problem and it works beautifully.

  • @phenomlab yeap, I see it now. Thank you very much. 🙏

    In Firefox (desktop), and in safari (mobile) I do not have any problem and it works beautifully.

    wrote on last edited by
    #13

    @crazycells Great !!

  • wrote on last edited by
    #14

    Previously, baris said: “For me ajaxifying between pages was breaking when I activated touchEnabled.”

    Is this change causing the same problem?

    PS. I do not know what ajaxifying is, I checked the definition but I did not really understand it. 🤣

  • Previously, baris said: “For me ajaxifying between pages was breaking when I activated touchEnabled.”

    Is this change causing the same problem?

    PS. I do not know what ajaxifying is, I checked the definition but I did not really understand it. 🤣

    wrote on last edited by
    #15

    @crazycells No, because we call the function again using

    $(window).on('action:ajaxify.end', function(data) {
    
  • @crazycells No, because we call the function again using

    $(window).on('action:ajaxify.end', function(data) {
    
    wrote on last edited by
    #16

    @phenomlab great! Good to hear that (although I do not understand fully)…

    Thanks a lot 😄

  • @phenomlab yeap, I see it now. Thank you very much. 🙏

    In Firefox (desktop), and in safari (mobile) I do not have any problem and it works beautifully.

    wrote on last edited by
    #17

    @crazycells said in Recent Cards - fix for slider on mobile not working:

    In Firefox (desktop), and in safari (mobile) I do not have any problem and it works beautifully.

    Are you using the code block from here ?
    https://sudonix.com/topic/257/recent-cards-fix-for-slider-on-mobile-not-working/3

  • phenomlab phenomlab referenced this topic on
  • Previously, baris said: “For me ajaxifying between pages was breaking when I activated touchEnabled.”

    Is this change causing the same problem?

    PS. I do not know what ajaxifying is, I checked the definition but I did not really understand it. 🤣

    wrote on last edited by phenomlab
    #18

    @crazycells said in Recent Cards - fix for slider on mobile not working:

    PS. I do not know what ajaxifying is, I checked the definition but I did not really understand it.

    AJAX is “Asynchronous Javascript And XML (Extensible Markup Language)” and means that requests for data can be sent and received without having to reload the entire page. This strategy is commonplace in today’s internet world - particularly for Single Page Applications (known as SPA’s)

  • @crazycells said in Recent Cards - fix for slider on mobile not working:

    In Firefox (desktop), and in safari (mobile) I do not have any problem and it works beautifully.

    Are you using the code block from here ?
    https://sudonix.com/topic/257/recent-cards-fix-for-slider-on-mobile-not-working/3

    wrote on last edited by
    #19

    @phenomlab no, I made these changes:

    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>
    

    Custom JS

    $(window).on('action:ajaxify.end', function(data) {
        $('.carousel-mode').bxSlider({
            stopAutoOnClick: true,
            pager: false
        });
    });
    
  • @crazycells said in Recent Cards - fix for slider on mobile not working:

    PS. I do not know what ajaxifying is, I checked the definition but I did not really understand it.

    AJAX is “Asynchronous Javascript And XML (Extensible Markup Language)” and means that requests for data can be sent and received without having to reload the entire page. This strategy is commonplace in today’s internet world - particularly for Single Page Applications (known as SPA’s)

    wrote on last edited by crazycells
    #20

    @phenomlab I changed the code to this:

    window.addEventListener("load", () => {
        // CHROME
        if (navigator.userAgent.indexOf("Chrome") != -1) {
            console.log("Google Chrome");
            $(window).on('action:ajaxify.end', function(data) {
                $('.carousel-mode').bxSlider({
                    auto: true,
                    autoControls: true,
                    stopAutoOnClick: true,
                    pager: false,
                    keyboardEnabled: true,
                    touchEnabled: false
                });
            });
        } else {
            console.log("Others");
            $(window).on('action:ajaxify.end', function(data) {
                $('.carousel-mode').bxSlider({
                    auto: true,
                    autoControls: true,
                    stopAutoOnClick: true,
                    pager: false,
                    keyboardEnabled: true,
                    touchEnabled: true
                });
            });
        }
    });
    

    with “auto: false” edit…

    and it is still working with firefox and safari; but not with google chrome.

  • @phenomlab I changed the code to this:

    window.addEventListener("load", () => {
        // CHROME
        if (navigator.userAgent.indexOf("Chrome") != -1) {
            console.log("Google Chrome");
            $(window).on('action:ajaxify.end', function(data) {
                $('.carousel-mode').bxSlider({
                    auto: true,
                    autoControls: true,
                    stopAutoOnClick: true,
                    pager: false,
                    keyboardEnabled: true,
                    touchEnabled: false
                });
            });
        } else {
            console.log("Others");
            $(window).on('action:ajaxify.end', function(data) {
                $('.carousel-mode').bxSlider({
                    auto: true,
                    autoControls: true,
                    stopAutoOnClick: true,
                    pager: false,
                    keyboardEnabled: true,
                    touchEnabled: true
                });
            });
        }
    });
    

    with “auto: false” edit…

    and it is still working with firefox and safari; but not with google chrome.

    wrote on last edited by
    #21

    @crazycells That’s correct. Because of the bug in Chrome, we have to disable touchEnabled

  • wrote on last edited by
    #22

    great topic, I will test than soon as possible 😉

  • great topic, I will test than soon as possible 😉

    wrote on last edited by
    #23

    @DownPW No issues. Thanks to the Google Chrome “bug”, it does have some restrictions, but works fine other than that. I have an odd issue where it doesn’t work on Firefox mobile, but works fine on Firefox desktop.


Related Topics
  • 3 Votes
    2 Posts
    2k Views
    DownPW
    Very great
  • navigation menu panel on mobile

    Solved Customisation nodebb css
    8
    1
    7 Votes
    8 Posts
    3k Views
    phenomlab
    @crazycells hmm. That’s odd. I haven’t made any changes from recollection but I could be wrong. I’ll need to check. EDIT - very strange. I honestly don’t recall adding the below CSS block to alter the bottom bar, but you’re right… .bottombar-nav { padding: 0px !important; } I’ve removed this so it reflects stock Harmony.
  • Link Not Working

    Solved Customisation link
    5
    1 Votes
    5 Posts
    2k Views
    phenomlab
    @cagatay Good question, but one that’s likely best answered by the devs themselves. Could easily be done with a simple jQuery regex but that would really just be painting over rotten wood.
  • How to fix header side as boxed

    Solved Customisation header boxed sudonix nodebb
    10
    1
    6 Votes
    10 Posts
    3k Views
    cagatay
    @phenomlab yes it caused a problem for mobile users. thank you for helping …
  • ineffecient use of space on mobile

    Solved Customisation nodebb
    10
    2
    7 Votes
    10 Posts
    4k Views
    crazycells
    @phenomlab Thanks
  • Recent Cards plugin customization

    Solved Customisation nodebb
    21
    1
    13 Votes
    21 Posts
    12k Views
    phenomlab
    @pobojmoks that’s easily done by modifying the code provided here so that it targets background rather than border In essence, the below should work $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { $('.recent-card-container').each(function(i) { var dataId = $(this).attr("data-cid"); var color = $('[role="presentation"]', this).css("background-color"); console.log("data-cid " + dataId + " is " + color); $('[data-cid="' + dataId + '"] .recent-card').attr("style", "background-color: " + color); }); }); });
  • [NodeBB] username cards

    Solved Customisation nodebb
    8
    5 Votes
    8 Posts
    3k Views
    Sampo2910
    @phenomlab Aha…nice to know. As always thank you for the reply and information.
  • Which mobile internet app and browser do you use?

    General browser mobile
    9
    3 Votes
    9 Posts
    3k Views
    phenomlab
    @Sala Yes, I personally use Edge. Hated Internet Exploder (misspell intentional) but seeing as Edge is Chromium and Webkit backed, it works for me.