Desktop froze up as modal failed to respond

I recently updated my modal to only work on screens smaller than tablets, which was successful. However, I now need it to also work on desktop size.

After trying to change d-none to d-block, it still didn't work.

Any suggestions?

<div class="col-5 col-sm-2 ml-auto aboutMid aboutMid1">
                            <figure class="cap-left">

                                <img src="assets/about/about1.jpg" class="img-fluid">
                                <a href="#myModal" role="button" data-toggle="modal" class="d-inline d-xl-none"><figcaption>
                                    The house is a converted farm building featuring traditional wooden shutters and terracotta roof tiles
                                    </figcaption></a>
                                <figcaption class="d-none d-xl-inline">
                                    The house is a converted farm building featuring traditional wooden shutters and terracotta roof tiles
                                </figcaption>
                            </figure>

                        </div>

                        <!-- Modal -->
                        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="#myModal" aria-hidden="true">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <div class="modal-body">
                                        <img src="assets/about/about1.jpg" class="img-fluid">
                                        The house is a converted farm building featuring traditional wooden shutters and terracotta roof tiles
                                    </div>

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

Answer №1

That code snippet was intentionally designed to function in a specific way based on the original asker's requirements.

To ensure the link displays on large screens, you can achieve this by commenting out or removing the second figcaption and eliminating the d-xl-none class from the first one.

Below is the modified code:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<div class="container">
    <div class="row">
        <div class="col-5 col-sm-2 ml-auto aboutMid aboutMid1">
            <figure class="cap-left">

                <img src="https://placeimg.com/640/480/animals" class="img-fluid">
                <a href="#myModal" role="button" data-toggle="modal" class="d-inline"><figcaption>
                    The house is a converted farm building featuring traditional wooden shutters and terracotta roof tiles
                    </figcaption></a>
<!--
                <figcaption class="d-none d-xl-inline">
                    The house is a converted farm building featuring traditional wooden shutters and terracotta roof tiles
                </figcaption>
-->
            </figure>
        </div>

        <!-- Modal -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="#myModal" aria-hidden="true">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-body">
                        <img src="https://placeimg.com/540/380/animals" class="img-fluid">
                        The house is a converted farm building featuring traditional wooden shutters and terracotta roof tiles
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

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

Tips for executing a join query in CodeIgniter

Hello, I am brand new to the CodeNighter framework and could really use some guidance on how to convert this join query into CodeNighter framework. Additionally, I need to know whether this join query should be placed in the model or controller. How can I ...

Is there a way to verify if the overflow of an element with a width of 100% has occurred?

Here is the structure I am working with: <div class="card"> <div class="container"> <slot /> </div> </div> The Card element has a fixed width of 33rem. The container within it spans 100% of ...

Drawer component from Material-UI placed on top of the sidebar

Currently, I am working on a project where I am using React TypeScript along with Material-UI. The issue that I am encountering is related to the width of the Drawer component provided by Material-UI. By default, the Drawer takes up the entire screen wid ...

Output the result of a MySQLI query using PHP's echo function

I am attempting to output my PHP while loop within an html echo. Essentially, I want to echo within another echo. Is this achievable? Below is the code snippet: <?php session_start(); require 'config.php'; if (@$_SESSION['username&ap ...

Aligning the initial item to the left and the rest to the right in a list using flexbox styling

I've been working hard to troubleshoot the header on my personal webpage. As it stands now, here is how it looks: https://i.sstatic.net/C4zSQ.png Currently, there's a simple paragraph with "ZH" on the left and three list items next to the logo. ...

In Google Chrome, the :after element on the left is cleared, while other browsers do not

In an effort to create a button using background images in the :before and :after pseudo-selectors for cross-browser compatibility, an issue arose where only Chrome did not display it correctly (Safari results were unknown). HTML: <div class="btn-cont ...

How can we prevent the text from shifting when the border width is adjusted

I've run into an irritating issue. My left menu text keeps shifting when I expand the border using jQuery. I've tried various solutions to prevent the text from moving, but nothing seems to work. Any suggestions? Could it be a CSS problem with t ...

Mastering the 'wing' corner effect using only CSS

Is there a way to achieve the corner effect shown in this image (top corners)? I'm not familiar with the name of this effect. If it is possible, how would you go about implementing it? Update: Some have suggested that this question is a duplicate. Ho ...

Incorporate a new JavaScript animation as the background for an established website, replacing the static background image

Seeking assistance with my portfolio as I delve into the world of Webdesign and learn the basics from templates. How can I integrate this javascript code into the background of my site, replacing the current minecraft image? Every attempt to implement it ...

Height of columns in Bootstrap 4 grid layout using row-cols

I am faced with a challenge while using the bootstrap grid system with the row-col attribute. The issue is that when columns wrap, they do not maintain the height of the tallest columns from the previous rows. Is there a way to ensure that the wrapped colu ...

What is the best way to format the JQGrid table for better

Is there a way to indent the table in this example and create white space on the side of the rows and header? I want a white margin on the left of everything below "Stackoverflow example". I'm hoping to achieve this using only CSS. Below is the code ...

Adjust a CSS variable with a simple click

I have a challenge where I want to double the value of an element's property every time it is clicked, using CSS variables. Here's what I have tried: #circle_1 { width:50px; height:50px; width: var(--size_1, 50px); heig ...

Guidelines on receiving a user's color input and showcasing it with JavaScript

/* Take a color input from the user and apply it to the variable called "message". */ <script type="text/javascript"> var textcol, message = "Great choice of color!"; textcol=window.prompt("Please enter a color:&quo ...

Utilize the Bootstrap 4 class to ensure that the navigation brand image is visible solely on medium screens or larger

<header> <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> <div class="container"> <a class="navbar-brand" href="#"> <img class="navbar-brand d-none d-md-block" src="img/logo.png"></ ...

Sending numerous parameters in a form

I'm having an issue with my code where the 'name' variable is POSTed but the 'project' variable is not when submitting through an 'onchange' event. I need both variables to go to session variables on submit. Can anyone sp ...

How to position a fixed element in relation to a wrapper div using HTML and CSS

I need assistance with positioning the floating box on the right side of the window on this particular page. My goal is to have this box relative to the white div containing all the text, so instead of it sticking to the window edge, it should float aroun ...

Tips on adjusting text size based on the browser window dimensions

There seems to be an issue with the text when the window size is decreased. It overlaps with the image instead of resizing accordingly. I have tried using media queries, VW, and VH units to adjust the text size based on the window size but it's not wo ...

Tips on configuring the path to incorporate Bootstrap CSS, JavaScript, and font files/classes into HTML when the HTML file and Bootstrap files are located in different directories

<!DOCTYPE html> <html> <head> <title>Unique Demo</title> <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" media="screen"> </head> <body> <div class="container"> <form ...

Displaying HTML elements in a specific order using ng-repeat

Upon receiving the json message, my goal is to display it in HTML in a specific order. Within the json message, the position value indicates the desired order of elements, with 0 representing the first element in the array. At times, the json message may ...

Alpinejs Mega Menu Issue: Hover Functionality Glitchy

I'm working on a complex Mega Menu project that is activated upon hovering, using the powerful combination of Tailwind CSS and Alpinejs. The functionality is mostly there, but I've encountered some bugs along the way. Despite my attempts to impl ...