The modal box fails to display upon clicking the <a> tag

I'm currently working on a website project that utilizes "fullpage.js" and includes multiple slides. Each slide features an info button created with an "a" element containing a glyphicon from bootstrap. When this info button is clicked, I intend for a modal box identified by the id modal1 to toggle its visibility from display:none to display:block.

The challenge I am facing is that the modal isn't appearing as expected. Despite adding console.log statements to debug the function when the button is clicked, no action occurs. While I'm using jQuery in my implementation, I'm open to suggestions if you have an alternative solution.

To streamline the question, I've omitted parts of the website setup which I deemed irrelevant. For reference, you can visit the live site at: this link

This is a snippet of my code :

HTML & Javascript

<head>
    <!--jQuery-->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!--    Bootstrap-->
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity=...

    <!--Google fonts-->
    <link href="https://fonts.googleapis.com/css?family=Prompt|Text+Me+One|Quicksand|Monoton" rel="stylesheet">

    <!--Fullpage.js-->
    <script src="Fullpage-js/fullPage.js-master/vendors/jquery.easings.min.js"></script>
    <link rel="stylesheet" type="text/css" href="Fullpage-js/jquery.fullPage.css" />
    <script type="text/javascript" src="Fullpage-js/jquery.fullPage.js"></script>
    <!--CSS file-->
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <!--particles.js-->
    <script src="particles.js-master/particles.js"></script>
    <script type="text/javascript">
        particlesJS.load('particles-js', 'particles.js-master/particlesjs-config.json', function () {
            console.log('callback - particles.js config loaded');
        });
    </script>
    <!--Fullpage setup-->
    <script type="text/javascript">
        $(document).ready(function () {
            $('#fullpage').fullpage({
                sectionsColor: ['rgba(255, 255, 255, 0)', 'rgba(105, 163, 193, 0.63)', 'rgba(255, 255, 255, 0)', '#f1937a', ],
                anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', ],
                //                    navigation: true,
                slidesNavigation: true,
                continuousVertical: true,
                verticalCentered: true,
...

CSS

/*colors used: 
Blue:#69a3c1
Orange:#f1937a
*/

.section {
    margin-top: 0;
}
.particles {
    height: 100vh !important;
    width: 100vw !important;
    position: fixed;
    z-index: 0;
}
body {
    margin: 0;
    font-family: "adam" !important;
}
.first {
    z-index: 1;
}
#fp-nav ul li a span,
.fp-slidesNav ul li a span {} #fp-nav ul li a.active span,
.fp-slidesNav ul li a.active span,
#fp-nav ul li:hover a.active span,
.fp-slidesNav ul li:hover a.active span {} .fp-prev {
    margin-left: 3vw;
}
.slideContainer h1 {
    font-family: 'Text Me One', sans-serif;
    font-weight: 200;
    color: black;
    font-size: 5vw;
}
.slideContainer {
    margin: 0 auto;
    width: 50vw;
    text-align: center;
}
...

Thanks!

Answer №1

Upon reviewing your website, I noticed that the modal button is functioning properly and successfully triggering the click event. However, there are a couple of issues that need addressing:

  1. Adjusting the toggle class .closed

    The bootstrap classes for toggling modals should be .modal-open, not .closed. You currently have the CSS set to display: none; for .modal, which means your toggle class has no effect. Changing this will resolve the issue.

  2. Correcting the modal positioning

    Your modal is currently positioned incorrectly, likely due to the CSS error mentioned in point (1). Once this bug is fixed, your modal will display as intended instead of being off-screen. Adjusting the position will ensure proper visibility.

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

Is it possible to include a scroll bar at the top of an overflow-x <div> in addition to or instead of the bottom?

Can the scroll bar be positioned at the top of a table instead of just the bottom? <div style="overflow-x: auto;"> <table> ... ... </table> </div> I am looking for a way to have the scroll bar appear at the top of my t ...

Implementing an if/else statement within an Ajax jQuery function would enhance its functionality

Can I include additional else functions in my JavaScript, such as this example: If the response is 'success', redirect to the home page. If the response is 'failed', redirect to a 'failed' page. $.ajax({ type: "POST", ...

What is the best way to display all values in the class when no selection is made in the drop-down menu?

I need assistance as I am facing an issue where all files are not appearing at the same time. It seems that the problem lies with the year option in my code. The year option requires at least one year to be chosen for it to work properly. I want to impleme ...

PHP failed to respond to the AJAX request

Currently, I am in the process of developing a straightforward signup page that utilizes jQuery and PHP with AJAX functionality. The following script is responsible for initiating the ajax call: <script> function submitForm(){ var data1=$( ...

Having trouble loading CSS and JavaScript files in CodeIgniter?

In my project, I am utilizing Bootstrap as a template. However, when attempting to access Bootstrap in Codeigniter, the page fails to load the CSS and JavaScript files. I have included the URL in autoload.php $autoload['helper'] = array('url ...

What can be done to ensure that the a href tag is functioning as clickable?

Having an issue with my HTML and CSS code for a notification dropdown box. I am unable to click the tag, even after attempting to use JavaScript. Can't seem to figure out what's causing this problem. Any advice on how to make the tag clickable? ...

What is the best method for seamlessly loading JSON data while transitioning between pages in a jqtouch application?

I've been working with JQTouch for my application. While the demos showed how to retrieve an html file and display it in the user interface, I'm dealing with loading JSON data that I want to incorporate into an existing DIV element. I prefer not ...

Creating a collision mechanism that functions with rotation

I am facing an issue with block collisions in my game. When I rotate the block, collision detection still treats it as a static box. I want to create hit boxes that are rotated along with the block, but I'm unsure of how to achieve this. Additionally ...

Obtaining an attribute of a row in a table using Selenium and Python

I've been trying to figure out how to check if this button (image) has been clicked: https://i.sstatic.net/Nc3Pe.png It's crucial for me to interact with this button, as it allows me to modify the price of certain items and protect them when ne ...

Ways to perfectly align objects in a container without compromising the height of the parent element

Within my container div, I have two spans. An issue arises when I attempt to align the items to the center using align-items: center, as this causes the spans to lose their defined height and border-radius properties. My goal is to keep the heights and bor ...

Is it possible to integrate Firebase Storage into a TypeScript/HTML/CSS project without the use of Angular or React?

For my project, I am aiming to create a login and register page using TypeScript. Currently, my code is functioning well even without a database. However, I would like to implement Firebase for storing user credentials so that the login process becomes mor ...

Restrict and Enable Scroll (with touchmove or alternate approach)

Seeking guidance on how to temporarily disable and enable scrolling on a mobile device. Upon researching, I came across the following solution: jQuery("body").bind("touchmove",function(e){ e.preventDefault(); return false; }); While t ...

Using AJAX to showcase information from a web API in organized table formats

Looking for guidance on integrating a web API from the URL "" using jQuery AJAX to populate a table. I've searched for tutorials without much success. ...

implementing a vertical separator in the main navigation bar

Is there a way to insert a vertical divider after each li element on the main menu? <ul class="nav navbar-nav"> <li><a href="#"><i class="fa fa-home"></i> <span class="sr-only">(current)</span></a>< ...

Step-by-step guide on adding a div inside another div:1. Start

Hey there! I'm currently in the process of building a website using PHP. One of the features on the site is a form for adding appointments. Users can input the date, start time, and end time of their appointment. Additionally, users have the ability t ...

Is there a way to modify a CSS class in Chrome that is only visible when I perform a drag action?

For the website project I am working on, I have an element that only changes its style when I drag something over it. This is achieved by adding a CSS class to it. However, editing this style has proven to be challenging because I cannot live edit it in C ...

Setting a minimum width for a single column in Bootstrap 4

After implementing a basic grid-based layout using Bootstrap 4, I encountered a challenge with the responsiveness of my columns. My layout consists of two columns: Left and Right. The left column is defined as div.col-12.col-md-5, while the right column i ...

Enhancing the functionality of LI elements by making them clickable when dynamically inserted into the webpage

I have successfully implemented a code using the Google Maps API that allows users to input a location, look it up on the map, and display the search result next to the map. The only part I'm struggling with is making these search results clickable so ...

The padding on the parent element's ::after pseudo-element appears to be overlooked by Firefox

I am facing an issue with positioning a down arrow using the ::after element. While it works perfectly in most browsers, Firefox seems to be causing trouble. Here is how it appears in Firefox: https://i.sstatic.net/tvpbr.jpg And here is how it looks in C ...

When you click the button, it will change colors. But when you click it again, it won't return to its original color

I am trying to implement a feature where clicking on the correct answer will change its color to green, while clicking on the wrong answer will change it to red. I also want to add an additional functionality: if the right-answer button is clicked twice, i ...