Create a layout with a single column that features a dynamic image, paired with another column housed within a modal using Bootstrap

I'm facing a design issue with a row that has two columns - one with an image and the other with a list of users in a modal window. As more users are loaded when scrolling down the modal, I want the image to remain fixed in its position. Here's the HTML structure:

<div class="modal fade" id="recognitionModal" tabindex="-1" role="dialog" aria-labelledby="recognitionModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-centered" role="document">
    <div class="modal-content">
        <div class="modal-header">
             <h5 class="modal-title" id="recognitionModalLabel">{% trans 'Let's appreciate someone today:)' %}</h5>
        </div>
        <div class="modal-body">
            <div class="row">
                <div class="col-12 recognition-container" id="recognizeWho">
                    <div class="row justify-content-center">
                        <!-- This column should be fixed -->
                        <div class="col-12 col-lg col-xl-6">
                            <img class="img-fluid" src="{% static 'image/heart.svg' %}" />
                        </div>
                        <div class="col-12 col-lg col-xl-4">
                            <!-- This section should also be fixed -->
                            <div class="form-group">
                                <div class="input-group input-group-alternative mb-4">
                                    <input class="form-control form-control-alternative" id="chooseColleague" placeholder="Choose your colleague.." type="text">
                                </div>
                            </div>
                            <!-- While this section is scrolling -->
                            <div>
                                <div class="who-to-recognize-container mb-2">
                                      <div class="who-to-recognize-row d-flex my-2" user_id="2"><div class="px-3 align-self-center"><div class="media"><span class="avatar avatar-sm rounded-circle bg-white shadow-sm border"><span class="text-dark">a</span> </span> <div class="media-body ml-2"><span class="username mb-0 text-sm font-weight-bold">admin </span> <small class="occupation text-muted d-block">Developer</small></div></div></div><div class="flex-grow-1 align-self-center mt-2"><div class="text-right"><span class="select-row-radio"></span> </div></div></div>

                                       [Repeated user rows removed for brevity]

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

Link to the jsfiddle example: modal

Answer №1

Include the following style for your image:

.fixed {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
}

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

An error occured upon loading FullCalendar: Uncaught TypeError - Unable to read property 'push' as it is undefined

First of all, thank you for your assistance. I've been trying to load FullCalendar (https://fullcalendar.io/) on my development environments but it doesn't seem to be working. When I check the console in Chrome, it shows me the following error m ...

"Struggling with getting the text color to change on hover in Tailwind

Today has been a frustrating day as I am diving into the world of tailwindcss and have been struggling with a particular issue. My code is below: <button className="bg-yellow-500 px-4 py-2 hover:text-black text-white"> Some Text Her ...

What is the procedure for displaying the complete text for choices on an ionic select button?

On my page, I have included an Ionic select button. The problem is that the options display a long string, and I want them to show the full text without truncating with dot-dot-dot like this: This is how my code looks: <ion-item *ngIf="select == &apos ...

"Concealing Querystrings in Node.js and AJAX: A Step-by-Step

I want to create a simple login form using the ajax Post method. However, I am having issues with the querystring still appearing in the URL. Can anyone help me resolve this issue? Thank you for any assistance! [ https://i.stack.imgur.com/R76O4.png http ...

Is it possible to implement smooth scrolling in HTML without using anchor animation?

Is it feasible to implement a more seamless scrolling experience for a website? I'm referring to the smooth scrolling effect seen in MS Word 2013, but I haven't come across any other instances of this. I've heard that AJAX can make such th ...

Customizing browser titles for various article pages on Joomla 3.2 for improved SEO performance

Is there a way to incorporate unique browser titles for various article pages? Additionally, I am seeking guidance on how to integrate distinct meta tags for different pages within a Joomla website... ...

Is it possible to manipulate elements within an overflow container using JavaScript/jQuery when using the HTML style "overflow:hidden"?

My <div> has a styling of style="overflow:hidden" and the size of the <body> is fixed, intended as a multi-screen display without a user interface. Is there a method to access these "invisible" elements to identify the first one that exceeds t ...

What is the best way to eliminate spaces, commas, and periods from a variable in javascript?

After attempting var res = str.replace(/ |,|.|/g, ""); and var res = str.replace(/ |,|.|/gi, "");, I'm still puzzled as to what I might be missing. var str = "Text with comma, space, and period."; var res = str.replace(/ |,|.|/g, ""); document.writ ...

What was the reason behind resolving the 0 height body problem by adjusting the WebView Layout Parameter?

My Xamarin WebView was not displaying my HTML correctly. Even though it was set to fill the whole screen, the body height in the HTML remained at 0px. In addition, I had a div in the HTML with the following style: position:absolute; top:0px; bottom:0px; ...

Issue with Angular JS: Unable to remove uploaded files

I'm currently learning about AngularJS and I've been working on uploading and deleting files. However, I've come across an issue with deleting files. Below is the HTML code: <div> <ul> <li ng-repeat="files in table.proce ...

Page not found: unique error on alternate route

My website has different paths and pages in hbs format, such as root, help, and 404. The problem arises when I navigate to localhost:3000/wrong, the site displays correctly, but when I try localhost:3000/help/wrong, the CSS is not applied to the 404 page b ...

HTML // jQuery - temporarily mute all audio for 10 seconds after page reload

Is there a way to automatically mute all audio sounds on my website for the first 10 seconds after it is reloaded, and then unmute again? <audio id="musWrited" autoplay> <source src="sound/soundl.mp3" type="audio/mp3" /> // < ...

Want to develop a web application and incorporate Ajax into it?

I'm sure many of you have created an online application that streamlines processes and saves time and money for your company. So, how did it go when you added some Ajax to enhance the user experience after developing the application? Any recommendat ...

Executing JavaScript code within ASP.NET Visual Basic

My current web application uses jQuery and JavaScript, but I want to add more features that are supported in ASP.net VB. However, I am unsure if the JavaScript can run after the VB code. Essentially, I would like the web app to follow this sequence: ...

Wordpress Bubble Notification - Conceal at Zero / Reveal at One or More

I am a beginner in PHP and CSS. After extensive reading and learning little by little, I successfully implemented notifications in my project using PHP and CSS. It functions properly, displaying the counts (friends, messages, and notifications) and redire ...

Display exclusively the provided value

Can someone please help me with printing in PDF style and displaying only the inputted value without showing the textbox or dropdown? Check out this image for reference I would like to achieve something similar, how can I do that? Any assistance would be ...

What is the most efficient method to match a list of titles with a distinct list of their associated links using Beautiful Soup 4 (bs

Update: I've found the solution! list_c = [[x, y] for x, y in zip(titleList, linkList)] Initial inquiry: In my project to scrape a recipe website using bs4, I encountered a challenge where the titles and links were not directly paired. After extracti ...

Troubleshooting Compatibility Issues: JavaScript Function Works in Chrome but not in Internet

After collaborating with fellow coders to develop info boxes using HTML, CSS, and JavaScript, I have come across an issue with the hover functionality not working properly in Internet Explorer. Interestingly, everything functions flawlessly on Google Chrom ...

Searching for a specific text within a column and displaying only the matching parts

My current dataframe has the following structure: RandomCol raw blah <div style="line-height:174%;text-align:left;font-size:9pt;"><font style="font-family:inherit;font-size:9pt;font-style:italic;font-weight:bold;">We ...

Encountering an undefined error while attempting to retrieve an object from an array by index in Angular

Once the page is loaded, it retrieves data on countries from my rest api. When a user selects a country, it then loads the corresponding cities for that country. Everything is functioning properly up to this point, however, upon opening the page, the city ...