Adjusting the height of a jQuery Mobile collapsible post-expansion

My jQuery collapsible is not resizing properly to fit the expanded content. Below is an example of the collapsible structure:

<div class="row collapsibles" data-role="collapsible">
    <h1>Supercategory A</h1>
    <div class="col-xs-7 txt">A1</div><div class="col-xs-5"><button class="btn">Go</button></div>
    <div class="col-xs-7 txt">A2</div><div class="col-xs-5"><button class="btn">Go</button></div>
</div>

To see the issue, you can visit: https://jsfiddle.net/pseudobison/xd6oejzz/18/. After expanding the collapsible, notice that the rounded corner at the bottom is misaligned.

I have attempted to set the height property and adjust the outer div's content, but I only managed to fix it temporarily by adding br tags. What is the correct way to address this issue?

Answer №1

When the content has a style of float: left but its parent does not, it can lead to issues with understanding the child's height.

Visit this JSFiddle link for an example.

<div class="collapsibles col-sm-12" data-role="collapsible">
   <h1>Supercategory A</h1>
     <div class="row">
       <div class="col-xs-7 txt">A1</div><div class="col-xs-5"><button class="btn">Go</button></div>
       <div class="col-xs-7 txt">A2</div><div class="col-xs-5"><button class="btn">Go</button></div>
    </div>
</div>

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

Replacing Material-UI dialog fonts

I have created a unique User Confirmation Dialog using the Material UI Dialog component, similar to the example provided here While working on customizing the dialog, I encountered an issue with changing the font. Although I was able to change the color a ...

Loading content dynamically with AJAX and enabling smooth page scrolling

Looking for a solution to this issue. I have a button on my webpage that, when clicked, uses AJAX to load content into a "div" element below the button. Everything functions properly except for one problem - every time the button is pressed, the page scrol ...

"Error occurs when attempting to insert indexes into a JSON array, causing the Dat

I am facing an issue with my datatable setup. I have a php array that is converted to a JSON array and populates the table successfully. However, when I try to add calculated fields to the table using PHP, it seems like Datatables is unable to read them pr ...

Executing Actions Prior to Redirecting

I am working on implementing a timer process using a custom JQuery plugin that will redirect to the login page after a specific number of minutes. Additionally, when the timer reaches zero, I need to execute a task, which in this case involves making a cal ...

determining the number of td elements in a row of a table located within an iframe

When I interact with a cell in a table within an iframe, I want to determine the number of cells in that row. If a cell is actually a span element, I would like to consider it as part of the cell count. The iframe may contain multiple tables without any s ...

The functionality of DataTables is not supported on Internet Explorer versions 8 and below

My current setup involves using DataTables to present data in a tabular format with pagination and sorting functionalities. While this is working smoothly across all browsers, I have encountered an issue specifically in IE versions 8 and below. According t ...

Change the space character ' ' to '-' when a key is lifted

Hey, I need some help with a coding problem. I have two input fields and I want to automatically mirror the text from the first input into the second input field using a keyup jquery function. However, my current setup adds a space whenever I hit the spac ...

Add a product to your shopping cart in Opencart with the help of Ajax manually

My goal is to automatically add a product to the cart when a user clicks on a button using a custom function that I created. Here is the code for the button: <input type="button" value="Add to cart" onclick="addItemsToCart(83); " class="button btn-suc ...

Guide on aligning a division within another division?

Included below is my HTML code: <div id="background_div"> <img id="background_img" src="images/background.jpg" alt="dont matter"> <i class="material-icons">perm_identity</i> <div id="dropdown"> <ul id=" ...

Enhancing jQuery Mobile listview with voting buttons on each item row

I am looking to incorporate 2 vote buttons within a jQuery mobile listview, positioned on the left-hand side and centered within each list item. While I have managed to achieve this using javascript, my goal is to accomplish it without any additional scrip ...

What is preventing the control from being passed back from the PHP file to the AJAX success function?

My website is built using PHP, Javascript, and AJAX. Below is the essential code snippet: JS code (AJAX function): $("#btn_add_event").click(function(){ var strSeriaze = $( "#formAddEvent" ).serialize(); url = $( "#formAddEvent" ).attr('act ...

Manipulate DIV elements with jQuery by selecting them based on their class names and then

Is there a way to use jQuery to eliminate all DIVs on a webpage while preserving their content that have the following specific pattern? <div class="ExternalClass85AC900AB26A481DBDC8ADAE7A02F039">....</div> Please note that these DIVs adhere ...

LabeFor does not automatically create the display-lable class attribute

When setting up a new MVC project, the default Site.css file typically includes the following styles: /* Styles for editor and display helpers ----------------------------------------------------------*/ .display-label, .editor-label { font-weight: ...

Overlap of sub menus

Seeking assistance from a CSS expert for a challenge I am facing. I am currently working on a toggle menu for mobile view, and encountering issues with the submenu. Any list item placed below another one with children is not visible. Removing the parent l ...

Error during compilation due to a missing parenthesis in the loop structure

I've been experimenting with creating a carousel using just html and css, without any Javascript. I've been exploring resources on the web and following tutorials to achieve this goal. However, I've encountered an issue. I created a mixin l ...

What is the process for submitting a form with the GET method to a third-party URL using jQuery and Ajax?

For my WordPress project, I am looking to submit a form using AJAX with the GET method. I have tried two methods but they are not working for me. There seems to be an issue in my code. Method-1 Using $.get $.get( "http://**.70.120.**/web/sms.aspx", { fu ...

Disappearing input field in DateTimePicker Bootstrap when blurred

Currently, I am utilizing the Bootstrap DateTimePicker plugin to enable users to select a specific date and time. The plugin functions well with one minor issue - whenever the user clicks outside or loses focus on the calendar box, both the box itself and ...

The time-out counter fails to detect the input field

After writing a method to reset the timeout on mouse click, keyup, and keypress events, I realized that it does not account for input fields. This means that when I am actively typing in a field, the timeout will still occur. Below is the code snippet: ...

Opening a Partial View (.ascx) in jQuery UI Dialog

I'm a bit confused about how to display a partial view in a jQuery UI Dialog window. I was initially using a simple Dialog but decided to explore other options for various reasons. Most online tutorials only demonstrate opening <div></div> ...

Can you confirm user online status without relying on ajax requests?

Is there a way to display online users/friends without relying on real-time ajax updates? I'm hoping to avoid making repeated ajax requests to the server at set intervals just to check user status. Right now, my application successfully shows online u ...