Modifying the small-dialog identifier in the Magnificent Popup

I recently encountered an issue while trying to change the ID name of the small-dialog in the Magnificent Popup JQuery Plugin. After making the necessary CSS adjustments to accommodate this change, the dialog box stopped functioning properly. I am now seeking guidance on how to troubleshoot and resolve this problem.

Here is the relevant HTML code:

                <li>
                    <a class="popup-with-zoom-anim" href="#small-dialogC"><?php echo $chase["Company"]; ?> </a>
                </li>
                <li>
                    <a class="popup-with-zoom-anim" href="#small-dialogB"><?php echo $bestBuy["Company"]; ?> </a>
                </li>
                <li>
                    <a class="popup-with-zoom-anim" href="#small-dialogR"><?php echo $rjsEatery["Company"]; ?> </a>
                </li>
                <li>
                    <a class="popup-with-zoom-anim" href="#small-dialogP"><?php echo $pizzaHut["Company"]; ?> </a>
                </li>

            </ul>
            <div id="small-dialogC" class="zoom-anim-dialog mfp-hide">
                <h1>The Details</h1>

                <?php echo '<dl>';
                     foreach ( $chase as $key => $value ) {
                     echo "<dt>$key</dt><dd>$value</dd>";
                    }
                    echo '</dl>'; ?>

            </div>

        <div id="small-dialogB" class="zoom-anim-dialog mfp-hide">
                <h1>The Details</h1>

                <?php echo '<dl>';
                     foreach ( $bestBuy as $key => $value ) {
                     echo "<dt>$key</dt><dd>$value</dd>";
                    }
                    echo '</dl>'; ?>

            </div>

        <div id="small-dialogR" class="zoom-anim-dialog mfp-hide">
                <h1>The Details</h1>

                <?php echo '<dl>';
                     foreach ( $rjsEatery as $key => $value ) {
                     echo "<dt>$key</dt><dd>$value</dd>";
                    }
                    echo '</dl>'; ?>

            </div>

        <div id="small-dialogP" class="zoom-anim-dialog mfp-hide">
                <h1>The Details</h1>

                <?php echo '<dl>';
                     foreach ( $pizzaHut as $key => $value ) {
                     echo "<dt>$key</dt><dd>$value</dd>";
                    }
                    echo '</dl>'; ?>

            </div>

        </section>

Below is the CSS code related to the small-dialog box:

    /* Styles for dialog window */
#small-dialogC
#small-dialogB
#small-dialogR
#small-dialogP {
    background: white;
    padding: 20px 30px;
    text-align: left;
    max-width: 400px;
    margin: 40px auto;
    position: relative;
}

My objective is to ensure that each link triggers a popup displaying the company details. Currently, when clicking on a link, the screen darkens, and the text appears on the left side instead of inside the centered white dialog box. I am seeking assistance to rectify this issue.

Answer №1

There seems to be a syntax error in your CSS code. To apply CSS to multiple IDs, make sure to use a "," separator. Try updating your CSS code as shown below, which should help resolve the issue.

 #small-dialogC,
 #small-dialogB,
 #small-dialogR,
 #small-dialogP 
{
background: white;
padding: 20px 30px;
text-align: left;
max-width: 400px;
margin: 40px auto;
position: relative;
}

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

User controls in ASP.NET may not trigger the jQuery (document).ready() function

I wrote a jQuery function within my ASP.net user control that is not functioning as expected: <head> <title></title> <script src="~/Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script language="javascript" ty ...

How can I show an item repeatedly with each button click in ReactJS?

Currently, I have a setup where I can display a checkbox and its label upon clicking a button. However, the limitation is that only one checkbox can be displayed at a time. Is there a way to modify this so that I can show multiple checkboxes simultaneous ...

Tips for adjusting the width of an li element based on the width of its longest content

My database dynamically populates an unordered list with content, utilizing the following code in the back end: StringBuilder output = new StringBuilder(); int lastDepth = -1; int numUL = 0; foreach (DataRow row in dt.Rows) { ...

The 8 x 8 grid I am constructing is functional, however, the issue lies in the fact that the first line only begins with a single # symbol

I am attempting to create an 8 x 8 grid. It's coming together, but the issue is that the first line only starts with one # sign. function print(msg) { console.log(msg); return msg; } let result = ""; for(let i=1; i<=8; i++) { result += ...

CSS Transform animation does not work when a class is added programmatically, although it functions properly when toggling the class in Chrome

Attempting to create an animation for the transform of a div. Below is the code with transition and transform properties in Safari: #mydiv{ transition: all 2.3s cubic-bezier(1, 0, 0, 1); transform: scale(0.5); background:white; padding:30 ...

Is there a way to illuminate a complete row by simply hovering over a span within one of the columns?

If I want to change the background-color of a div with classes "row" and "highlightThisRow" when hovering over a span with the class "fromThisSpan", how can I achieve that? In a list, there are multiple rows with several columns. The span in question is l ...

How to locate every JavaScript event connected with an HTML element by utilizing Google Chrome

Looking for an easy method to identify all JavaScript events linked to a specific HTML element in Chrome? For example: HTML element <a href="#" class="cancel_link refresh_page">Cancel</a> Script: <script type="text/javascript"> $ ...

one container stacked on top of another

I have been creating web pages using tables for a long time. Recently, I decided to make the switch to using divs like everyone else, but it has been quite challenging. Can anyone help me solve this issue? I have included an image to better illustrate the ...

Adding a div element to the canvas and generating a DataURL is currently experiencing technical difficulties

My task involves displaying an image with two div elements placed above it - one containing an image and the other containing text. I need to combine these three elements to create a final image and store it in a database/server. To achieve this, I am usin ...

Is there a way to display the title of a custom post type as a clickable link that directs to the corresponding post

I am trying to retrieve the title of a custom post type and link it to the related post. Here is the code I have so far: query_posts( 'post_type=custom_post_type&posts_per_page=1&order=DESC' ); while (have_posts()) : the_post(); echo " ...

Designing a solid sidebar of a specific width alongside a flexible container for content that adapts to different screen sizes using

I have a sidebar that is fixed at 200px on the left side of the page, and a responsive content container on the right side. To center the content in the right container, I used the following CSS: .sidebar { width: 10%; position: fixed; height: 100%; bac ...

Struggling to eliminate background color from Bootstrap navigation on top of image slider?

I am currently attempting to make the second navigation bar transparent so that the image behind it is visible. I have tried applying CSS to achieve this transparency: #nav > .navbar-inner { border-width: 0px; -webkit-box-shadow: 0px 0px; box-shadow: 0 ...

Click the link to copy it and then paste the hyperlink

I am facing an issue with copying and pasting file names as hyperlinks. I have checkboxes next to multiple files and a share button. When I check the boxes and click on the share button, I want to copy the download URLs for those files. Although I can succ ...

How can I modify the color of a div when a validation error occurs?

I have recently completed a contact form with validation using the constraint validation api. Although the files are functioning as intended, I am curious if there is a method to make the error boxes turn red when an error occurs and white (or hidden) when ...

Customizing Material UI tooltip styles with inline CSS formatting

Currently in the process of creating a React component that utilizes the Material UI Tooltip feature. In my component, I have the need to manually reposition the Mui Tooltip by targeting the root popper element (MuiTooltip-popper). However, the Mui Toolti ...

php code to paginate mysql results

Imagine I have 50 rows in my database. How can I retrieve MySQL results in pages, displaying 5 results on each page and showcasing the pages as follows: [1], 2, 3, 4...10? For example, if it's on page 5, show 3, 4, [5], 6, 7...10 without refreshing al ...

Tips for submitting multiple radio button values in a tabular format

HTML Code: <div class="tab"><h4>Zip Code</h4> <p><input type="text" class="text1" placeholder="Enter zip code..." oninput="this.className = ''" name="zipcode"></p> </div> <div class="tab">& ...

Creating a List Item with Equal Height as Its Parent Container

<nav> <ul id="navUl"> <li> <div class="settingsDiv"> hey </div> </li> </ul> </nav> I am trying to adjust the height of the div element to match the height of the nav. My g ...

Using the mousewheel to scroll over an iframe is not functioning properly in Internet Explorer versions 8 through 11

I have implemented Perfect-Scrollbar, a jQuery script, which works well in Firefox, Safari, Chrome, and Opera. However, I am facing an issue with scrolling using the mouse wheel when it is used in combination with an iframe in Internet Explorer versions 8 ...

utilizing jquery for dynamic color changes

Check out the code snippet below, which involves the bootstrap accordion and showcases certain elements within the title section. <dt><span><i class="fa fa-tachometer" aria-hidden="true"></i>&nbsp;&nbsp;Manage</span>& ...