Trouble with Bootstrap accordion data-toggle function on mobile devices

I noticed that someone else had asked a similar question without receiving an answer. I am currently having issues with Bootstrap's data-toggle for an accordion, particularly on mobile devices (not just IOS but also on Chrome developer tools and my Galaxy S8).

<!-- How it Works -->
<div id="howItWorks" class="interiorContent">
    <div class="container">
        <div class="intContHead">
            <h2>How it Works</h2>
        </div>

        <div class="accordion" id="howItWorksAccordion">
            <div class="card">
                <div class="card-header" id="headingOne">
                    <h6 class="mb-0">
                        <a role="button" data-toggle="collapse" data-parent="#howItWorksAccordion" data-target="#collapseOne" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                            Step 1: Create ASComm.NET Configuration File
                        </a>
                    </h6>
                </div>

                <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#howItWorksAccordion">
                    <div class="card-body">

                        <p>For more advanced applications (branded, database, etc.), you can build your own configuration
                            application that utilizes ASComm.NET's configuration and serialization capabilities.</p>

                    </div>
                </div>
            </div>
            <div class="card">
                <div class="card-header" id="headingTwo">
                    <h6 class="mb-0">
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#howItWorksAccordion" href="#collapseTwo" aria-expanded="false"
                            aria-controls="collapseTwo">
                            Step 2: Add ASComm Excel Add-in to Excel.
                        </a>
                    </h6>
                </div>
                <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#howItWorksAccordion">
                    <div class="card-body">
                        <p>
                            <strong>NOTE: Step 2 only needs to be perfomed once. If you have already added ASComm.NET Excel Add-in
                                to Excel, proceed to Step 3.</strong>
                        </p>

                    </div>
                </div>
            </div>
            <div class="card">
                <div class="card-header" id="headingThree">
                    <h6 class="mb-0">
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#howItWorksAccordion" href="#collapseThree" aria-expanded="false"
                            aria-controls="collapseThree">
                            Step 3: Configure ASComm.NET Excel Add-in Operating Parameters
                        </a>
                    </h6>
                </div>
                <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#howItWorksAccordion">
                    <div class="card-body">
                        <p>3.1 Locate the ASComm.NET tab on the Excel ribbon</p>

                    </div>
                </div>
            </div>
            <div class="card">
                <div class="card-header" id="headingFour">
                    <h6 class="mb-0">
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#howItWorksAccordion" href="#collapseFour" aria-expanded="false"
                            aria-controls="collapseFour">
                            How to Read and Log Data
                        </a>
                    </h6>
                </div>
                <div id="collapseFour" class="collapse" aria-labelledby="headingFour" data-parent="#howItWorksAccordion">
                    <div class="card-body">
                        <img alt="Excel AddIn Ribbon" class="img-responsive" src="../../../images/ascomm_excel_addin_ribbon.png">

                    </div>
                </div>
            </div>
            <div class="card">
                <div class="card-header" id="headingFive">
                    <h6 class="mb-0">
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#howItWorksAccordion" href="#collapseFive" aria-expanded="false"
                            aria-controls="collapseFive">
                            How to Write Data
                        </a>
                    </h6>
                </div>
                <div id="collapseFive" class="collapse" aria-labelledby="headingFive" data-parent="#howItWorksAccordion">
                    <div class="card-body">
                        <!--Manual Start-->
                        <p>ASComm Excel Add-in can read data from hardware devices and populate Excel spreadsheets without
                            writing any code.</p>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

I attempted adding cursor: pointer to my anchor tags and changing them to button tags. While observing the elements in Chrome developer tools as I clicked on the links, I noticed that the first card transitions from class="collapse show" to class="collapsing" and finally to class="collapse," yet no visible change occurs. (The first card is meant to be displayed upon page load).

Answer №1

I recently inserted your code into an in-progress project file that was then uploaded to a web server. To my delight, everything functioned perfectly without any issues. I conducted thorough testing on the Chrome Mobile Browser, specifically version 68.0. Here are the versions of some key components that were utilized during this process: - Bootstrap 4.1.2 - jQuery 3.3.1 - Popper.js 1.14.3

Answer №2

Make certain that the essential Bootstrap JavaScript files are present. The accordion feature hinges on Bootstrap's arsenal of JavaScript plugins, thus verify that you have integrated either the bootstrap.js or bootstrap.min.js file within your project setup. This can be done by opting for a content delivery network (CDN) or by directly downloading the file and establishing a linkage to it in your HTML document.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a way to ensure that the background position remains stable and does not shift or collapse?

Still getting the hang of all this, but I'm making progress by learning on the go and enrolling in courses. Sometimes I face small obstacles like the one I'm encountering now. Everything looks great when the browser is at 100%, but when I minimi ...

Guide on excluding the <src and <href tags from a JSON response in Blogger

"content": "\u003cvideo controls width=800 autoplay\u003e\n \u003csource src=\"https://srv-file8.gofile.io/download/AEiT5Y/www.4MovieRulz.ch - Sunny Winter (2020) 720p Hindi Part-2 HDRip x264 AAC 500MB.mkv&bs ...

What is the best way to ensure that Bootstrap columns are spacious enough to fit advertisements?

Using Bootstrap 5, I have created a page layout with 3 columns: <div class="container"> <div class="row"> <div class="col-md-3">LEFT</div> <div class="col-md-6">CENTER</div& ...

What is the most effective way to determine which radio button is currently selected in a group with the same name using JQuery?

<form class="responses"> <input type="radio" name="option" value="0">False</input> <input type="radio" name="option" value="1">True</input> </form> Just tested: $('[name="option"]').is(':checked ...

Sorting through a table based on the name of the element

I am currently working on filtering an HTML table using a search form. It's working great, but I'm facing an issue where the filtered elements are trying to fill the entire width of the table instead of maintaining their original width (which is ...

Adjust the bootstrap switch component to be in the 'checked' state when the mode is set to Dark

I have stored a theme for my web application in the localStorage and I want to dynamically add the checked value to the Switch component if the mode is set to 'dark', or unchecked if the mode is 'light'. However, whenever I set the them ...

Ensuring the correct width for a .png image in an email newsletter for Outlook 2013

After creating an email newsletter that works perfectly on all email clients except Outlook 2013, I realized that the image I included is not adhering to the table width specified. Instead, it is defaulting to its own width of 658px. View image here Below ...

Automate web tasks with C# WebBrowser

Currently, I am in the initial phases of developing a system to automate the process of data extraction and collection from a website. I have a massive CSV file containing 16,000 lines of data. My goal is to input data from each line into a textarea on a w ...

Is there a way to adjust the text color based on whether a value is negative?

I am currently developing a web application that performs addition operations on integers. Within this application, I have implemented two functions named num1() and num2() to retrieve the integers provided by the user for calculation. My objective is to m ...

Difficulty in adjusting the height of the popover menu that appears when using the Select Validator in Material UI

I am having trouble adjusting the height of a popover that emerges from a select validator form in Material UI. Despite attempting various methods, including adding the following CSS to the main class: '& .MuiPopover-paper': { height: &apos ...

Mastering the art of manipulating Div elements using CSS for the optimal Print View experience

I have a table with several columns and 1000 rows. When I print the page, it breaks the rows onto different pages, showing the remaining rows on subsequent pages. I want to display the complete record in one go. Below is a sample code with only one row in ...

The navigation links in the Bootstrap navbar become unresponsive when the window is resized

I created a user interface using Bootstrap 4 with a sticky navigation bar. However, I am encountering a problem where the links do not consistently navigate users on smaller screens, specifically when using the hamburger menu. To replicate the issue (scre ...

Integrate a scaling feature into an HTML webpage

I am having trouble with the columns in my div not being equal widths. Does anyone have any suggestions on how to fix this issue? Does anyone know of a better way to create a scale using div elements instead of tables? <DIV class="scale"> <D ...

Arrange objects in dropdown menu to line up

I'm currently working on a dropdown menu and I have a specific requirement – the menu should always be split into two columns and be able to span multiple lines. However, I've encountered an issue where the columns are not aligned properly, cau ...

What is the method for opening the image gallery in a Progressive Web App (PWA)?

I am struggling to figure out how to access the image gallery from a Progressive Web App (PWA). The PWA allows me to take pictures and upload them on a desktop, but when it comes to a mobile device, I can only access the camera to take photos. I have tried ...

Methods for altering the color of a div using addEventListener

Why doesn't the color change when I click on the div with the class "round"? Also, how can I implement a color change onclick? var round = document.querySelector(".round"); round.addEventListener("click", function() { round.style.backgroundCol ...

Creating immersive experiences with fabric.js in fullscreen mode on canvas

Attempting to implement a fullscreen mode (using HTML5 fullscreen) for a canvas object created with Fabric.js. var canvas = fabricCanvas.getSelectionElement(); if(canvas.requestFullScreen) { canvas.requestFullScreen(); } else if(canvas.webkitRequestFu ...

Using Javascript to display different div elements based on the type of mobile device

My goal is to use JavaScript to accomplish the following: 1- Check the mobile device type, if it is an ANDROID device, show the ANDROID_USERS div. If it is an IPHONE device, show the IOS_USERS div. 2- Display the above div only once during the first visit ...

Is the absence of http(s) in <link ...> causing any issues?

I recently noticed a peculiar link on the Font Awesome homepage that seems to work without including http or https. <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> This made me wonder, what does // a ...

Adjusting my navbar to dynamically resize with the changing window dimensions

Seeking guidance on creating a responsive navbar. Currently, I've successfully adjusted the bar's size based on monitor resolution, but the buttons remain static in size. I experimented with using %, vm, and vh, but suspect that there might be a ...