Accordions in Semantic UI that open into a modal window

Update: I have identified the issue, but I am unsure how to resolve it. The problem seems to be with semant.js and jquery.ui.js

Error: http://jsfiddle.net/taioli/tg21uLoh/12/

Resolution (without jquery.ui) http://jsfiddle.net/taioli/tg21uLoh/11/

I am struggling to comprehend this issue. I have an accordion inside a modal that is not functioning properly. Initially, I suspected a CSS conflict, however, after conducting some tests, I confirmed there is no CSS conflict.

Modal

<div class="ui modal history">
    <i class="close icon"></i>
    <div class="header">
        Profile Picture
    </div>
    <div class="content">

        <div class="ui accordion">
            <div class="title">
                <i class="dropdown icon"></i>
                What is a dog?
            </div>
            <div class="content">
                <p class="transition ">A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.</p>
            </div>
            <div class="title">
                <i class="dropdown icon"></i>
                What kinds of dogs are there?
            </div>
            <div class="content">
                <p class="transition hidden">There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog that they find to be compatible with their own lifestyle and desires from a companion.</p>
            </div>
            <div class="title ">
                <i class="dropdown icon"></i>
                How do you acquire a dog?
            </div>
            <div class="content ">
                <p class="transition ">Three common ways for a prospective owner to acquire a dog is from pet shops, private owners, or shelters.</p>
                <p class="transition ">A pet shop may be the most convenient way to buy a dog. Buying a dog from a private owner allows you to assess the pedigree and upbringing of your dog before choosing to take it home. Lastly, finding your dog from a shelter, helps give a good home to a dog who may not find one so readily.</p>
            </div>
        </div>
    </div>
    <div class="actions">
        <div class="ui black deny button">
            Nope
        </div>
        <div class="ui positive right labeled icon button">
            Yep, that's me
            <i class="checkmark icon"></i>
        </div>
    </div>
</div>

Javascript

Within document ready

$('.ui.accordion').accordion();

$('.ui.modal.history').modal('show');

I tested this on a jsfiddle and it worked perfectly. However, on my webpage, I encountered this issue: https://i.sstatic.net/Lq3Py.png

The first item is not functioning correctly.

It is especially peculiar that in an identical jsfiddle, everything functions as intended.

Answer №1

Both Semantic.js and jQuery-ui.js share a common function known as 'Accordion'

To explore further, visit https://jqueryui.com/download/

You can customize your own jquery-ui library by excluding the component accordion.

This could potentially resolve any issues you are facing.

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

How can I use CSS to clip the United States, specifically Tennessee and Nashville, from the left side?

For my ASP.NET generated hyperlink that says "select location", when the user clicks on it, they are redirected to a new page where they can choose a different location at /change-location/default.aspx. This could be any country, state, or city in the worl ...

Arranging a series of images with unique effects and clickable links in a single row

How do I center these images on any monitor size, regardless of the screen dimensions? I've experimented with various methods like “left: auto;, relative, -10%, …” I'm not sure if they are inside a container or not, but if I could place t ...

Tips for managing event listeners with JavaScript validation and PHP

Hi everyone, I'm a new student learning Web Programming and focusing on Web Development. I encountered an issue while trying to use JavaScript validation with a form submitted to a PHP file. I attempted to utilize event listeners to check the input fi ...

Is there a way for me to conceal my table upon clicking on the sidebar? Additionally, when I click on a button to display a different table, can the currently visible table automatically close?

I have a unique table for each button. Initially, the tables are hidden using CSS visibility: 'hidden', and when I click a button, the corresponding table displays. However, the issue arises when I click the same button again as it fails to hide ...

Is it achievable to align this in the center?

UPDATE: I managed to resolve the issue using this method (Big thanks to everyone who offered suggestions) var intDuration = 50; setInterval( function(){ $('#image').animate({"margin-left": "-=0.05%", "margin-top": "-=0.05%", "width": "+=0.1%" ...

Move from right to left on the slide?

Is there a way to toggle a div's visibility between collapsed and expanded, transitioning smoothly from right to left? I've noticed that most examples I come across demonstrate the transition from left to right. ...

What is the best way to show the title when a user hovers over a word?

Below is an illustration of the code: <p>Bob's <dfn title="Dog">canine</dfn> mother and <dfn title="Horse">equine</dfn> father sat him down and carefully explained that he was an <dfn title="A mutation that combines ...

How to extract text from an HTML element using Selenium

In the following HTML snippet, I need to extract the text of elements 1 and 2 individually. <div class="sc-492bf320-0 sc-7d450bff-9 crIwBV juiSXn"> <div data-change-key="homeScore.display" class="sc-18688171-0 sc-7d450bf ...

Is the IE7 Modal Dialog Misaligned?

Update After some investigation, I discovered the root cause of the problem. In my code, I was referencing the height of the overlay, which resulted in different values in IE7 compared to other browsers. To resolve this issue, I adjusted the code to refe ...

Tips on accessing the left value of a absolutely positioned object that transitions on click using getComputedStyle or a similar method

Question: How can I ensure that when the target is clicked, the correct and updated value of the left property is returned? For example, I want it to return 120px if --moved is applied, and 100px if it is not applied. Background: Utilizing getComputedStyl ...

Creating page borders in print CSS for each individual page is a helpful way to enhance the visual appeal

I am facing an issue where I have a lengthy HTML document that is ready for printing, but I need to add borders to every page. I tried adding body { border:2px #666 solid; padding:5px; } in the CSS code, which looked good in the HTML view, but not in the p ...

Why doesn't "align-self: flex-end" relocate the game board to the bottom of the screen?

Hey there, I am currently working on developing a Connect 4 game and have decided to use a table for the board. To position the board properly, I am utilizing flexbox. Although I have specified align-items as 'flex-end' in order to bring it to th ...

Addressing Browser Incompatibility in React.js Event Handling

I've recently embarked on my journey to learn React.js by delving into various tutorials and documentation. However, I'm encountering a peculiar issue specifically in Google Chrome: https://i.sstatic.net/qODiP.png Interestingly, in Firefox, it ...

Using JavaScript, aim for a specific element by its anchor headline

I'm looking to make some changes to my navigation menu, specifically hiding the home menu item unless the mobile navigation menu is toggled. Is there a way for me to target the "home" anchor title and apply the active class to it when toggled, similar ...

What is the best way to create a responsive sidebar that stays in place?

One feature that stands out on this site is the elegant sidebar: I've figured out how to create a fixed sidebar in css, but I'm struggling with making it stop scrolling at a specific point. I believe making it disappear at a certain width involv ...

Revamp the button's visual presentation when it is in an active state

Currently, I'm facing a challenge with altering the visual appearance of a button. Specifically, I want to make it resemble an arrow protruding from it, indicating that it is the active button. The button in question is enclosed within a card componen ...

What to do when the image-sprite is too large for the container and needs to be resized to fit within a smaller

Is there a way to resize the sprite image to fit the container without using the tag? The sprite image dimensions are 562px (x5) width x 562px height main-desktop.png .container_outer{ height:200px; width:100%; } .chrome-part, .ie-part, .firefox- ...

The CSS code for ::before is not functioning properly

Trying to enhance the style in Ionic2, I have a message box: https://i.sstatic.net/PCRtA.png I am attempting to integrate this image into it: https://i.sstatic.net/PSQID.png To create a seamless look with the message box. Facing an issue where the ima ...

Ways to stop button from wrapping inside a div

While working on a search page, I encountered an issue where the submit button overlaps with the text input when zooming in due to lack of space. Is there a solution to prevent this overlapping and keep the layout intact? HTML <input type="text> &l ...

I'm having an issue with a jQuery navigation plugin that is causing the entire page to refresh. Does anyone

My website includes a jquery slider plugin that I use for navigating between slides. I decided to apply absolute positioning for the previous/next slide navigation, but now I am facing an issue where the navigation refreshes the entire page. Can someone ...