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

Trigger specific scripts again after loading jQuery AJAX

Is there a way to make specific scripts re-run after an AJAX load is completed? ...

What causes the Request.Params of IHttpHandler to be accurate on the initial call, but become null on the subsequent call?

My HTML/Javascript page utilizes a jQuery ajax call to communicate with a .NET ajax handler (.ASHX). The issue arises in subsequent calls where the parameters passed in the data object are unexpectedly NULL despite being correct during the first call. Her ...

Angular-ui-bootstrap-tabs feature smooth transitions when switching between tabs, but lacks animation when moving

Just made some updates to an example by user @austin Encountering an issue when trying to transition backwards (from tab3 to tab2), but it works fine when transitioning forward. I'm not sure what I'm missing here, so any help would be appreciate ...

Steps to Activate a Hyperlink for Opening a Modal Dialogue Box and Allowing it to Open in a New Tab Simultaneously

I am currently working on a website project. Within the website, there is a hyperlink labeled "View Page". The intention is for this link to open the linked page in a modal dialog upon being clicked. Below is the code snippet that I have used to achieve t ...

Changing an HTML container using jQuery and Ajax to facilitate a login process

Currently, I am on the lookout for a unique jQuery plugin that can replace a div when a successful login occurs. Despite searching multiple times on Google, I have been unable to find an ideal plugin that meets my specific needs. Do any of you happen to kn ...

AJAX requires manual updating by clicking on a button

I've created a chat system where two individuals can communicate with each other. An AJAX function has been implemented to update the message container every 2 seconds. However, I have noticed that the AJAX call doesn't run immediately after a u ...

My webpage's `div` element is not loading properly when using the `.click(function()`, but magically works

Personal Website Issue Encountering a problem with a hidden div not fully loading when triggered by an .click(function(). After researching the issue and attempting both $(document).ready(function() and window.onload, my problem persists. IMPORTANT: The ...

Is it possible to improve the cleanliness of a dynamic button in Jquery?

I've just finished creating a dynamic button on the screen as per my boss's request. When this button is clicked, it triggers an email window for feedback submission. My aim is to streamline this script so that I can avoid digging into ASP marku ...

Absence of MVC5 Vanilla Layouts

Creating my first MVC5/Razor application from the ground up, I want to avoid including unnecessary references that cause bloat. In the Views folder, I have separate Home and Shared subfolders. The Home folder contains Index.cshtml, while the Shared folder ...

How to Maintain Hover State After Leaving an Element in jQuery?

1. I am working on a website with two menus, "Main" and "Sub". When you hover over a specific link in the main menu, it highlights the corresponding link in the sub-menu by adding a class to it. However, the issue is that when I move my cursor off the main ...

How to Incorporate an Anchor Link into a Div as well as its Pseudo Element using CSS, Javascript, or jQuery

How can I make both the menu item and its icon clickable as a link? When either is clicked, the link should work. Here is a CodePen example: http://codepen.io/emilychews/pen/wJrqaR The red square serves as the container for the icon that will be used. ...

Creating a bootstrap modal with backbone framework

To better illustrate my problem, I believe a code snippet will be helpful. Here is the view: App.Views.ErrorModal = Backbone.View.extend({ template: window.template('errorModal'), render: function(){ this.$el.html(this.template(this.mod ...

The Consequences of Using Undeclared Variables in JavaScript

What is the reason behind JavaScript throwing a reference error when attempting to use an undeclared variable, but allowing it to be set to a value? For example: a = 10; //creates global variable a and sets value to 10 even though it's undeclared al ...

Incorporating dual CSS stylesheets into a single HTML document

I have been utilizing jsonform from https://github.com/joshfire/jsonform to create forms based on a json schema. However, jsonform requires its own css for the form, while I prefer to use a different css for my website's template. Is there a method t ...

What is the best way to utilize jquery .grep() for searching and modifying an object?

I am working on a straightforward algorithm that involves retrieving an object from a jQuery key/value array, making some updates to it, and then replacing the original object within the array with the updated one. Can anyone guide me on how to accomplish ...

What is the best way to appropriately update a partial that displays another partial (refreshing with JavaScript leads to a page within a page)?

Update 2 - marzapower's assistance proved valuable once again. The success section in the ajax was identified as the root cause of the issue, as explained below. UPDATE: marzapower's solution works effectively (refer to it below), but I require ...

What Happens When You Click on a Link in Google News Using the Mobile Chrome Browser

When using the Chrome Browser on mobile to open a news link from Google News, a new tab is opened. To return to Google News, users can click on the white-highlighted "left arrow" below or find a small header with a "<" symbol above to navigate back. Ho ...

javascript image alert

I want to upgrade a basic javascript alert to make it look more visually appealing. Currently, the alert is generated using if(isset($_GET['return'])) { // get a random item $sql = "SELECT * FROM pp_undergroundItems AS u LEFT JO ...

Issue with CSS styles not linking correctly to ejs templates

I'm having trouble linking my CSS stylesheet in my project. I have the CSS file stored in a public folder with a css subfolder within it. Despite trying various methods, I can't seem to get the stylesheet to connect properly. Below is a snippet f ...

javascript strange behavior

I am facing an issue with my code that is attempting to display images based on their height. Strangely, the code seems to work fine when I test it with 2 images, but fails when trying with 3 or more. Check out the site: Upon clicking a menu button, the ...