How disable data-toggle="collapse" action in desktop view

Iam using the bootstrap frame work for toggle collapse, for mobile view is that ok but i need to remove the data-toggle="collapse" action in desktop view. Any one can help me

I would need a little more information so I would be able to pinpoint what you are truly trying to do, so the script below is based on using the Bootstrap Studio's "Accordion" default settings from drag and drop.

You will need to make some adjustments accordingly to fit your code you are using.

Change the width's tested value of 768 (tablet break point). Right now it will uncollapse when screen width is greater or equal to 768.

You will also need to change the ID of "#accordion-1" to what ever you have configured in your element you are trying to do this on.

The script runs after page first loads and runs on re-sizing.

function adjustCollapseView(){
    var desktopView = $(document).width();
    if(desktopView >= "768"){
        $("#accordion-1 a[data-toggle]").attr("data-toggle","");
        $("#accordion-1 .collapse").addClass("in").css("height","auto")
    }else{
        $("#accordion-1 a[data-toggle]").attr("data-toggle","collapse");
        $("#accordion-1 .collapse").removeClass("in").css("height","0")
        $("#accordion-1 .collapse:first").addClass("in").css("height","auto")
    }
}

$(function(){
    adjustCollapseView();
    $(window).on("resize", function(){
        adjustCollapseView();
    });
});

Hope this helps you :)

Saj