Mobile devices are unable to properly implement the Jquery show/hide feature

Currently, I am working on a small Russian project and facing some challenges with the mobile version of my website: php8098.github.io/breakfast.

The issue lies within the first slider where the play button should trigger a modal window to open. I urgently need assistance in fixing this bug before tomorrow, and I apologize if my question seems somewhat trivial.

Below is the jQuery code snippet:

$('.button-play-1').on("click", function(){
    $('.video-popup-1').show()
    });
    $('.close-1').on("click", function(){
    $('.video-popup').hide()
    });

Here's the corresponding HTML:


           <div class="feedback-slider">
                <div class="feedback-slide feedback-slide-1">
                    <button class="button-play button-play-1">
                    <img src="img/play.png" alt="">
                    </button>
                </div>
                <div class="feedback-slide feedback-slide-2">
                    <button class="button-play button-play-2">
                    <img src="img/play.png" alt="">
                    </button>
                </div>
                ... (remaining feedback-slide elements)
            </div>
            <div class="video-popup video-popup-1">
            <div class="popup">
                <iframe width="380" height="403" src="https://www.youtube.com/embed/B3DP2rwQmpI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                <div class="close close-1">
                <img src="img/close.png" alt=""></div>
            </div>
        </div>

CSS styles used for the video popup:


.video-popup {
  position: fixed;
  display: none;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  background-color: rgba(0, 0, 0, 0.8);
}
.popup {
  position: fixed;
  left: 50%;
  top: 7%;
  width: 420px;
  height: 550px;
  -webkit-transform: translateX(-50%);
  -ms-transform: translateX(-50%);
  transform: translateX(-50%);
  background: #fff;
  border-radius: 10px;
}

.popup iframe {
  margin-left: 20px;
  margin-top: 70px;
}

.close {
  position: absolute;
  right: -10px;
  top: -15px;
  font-size: 35px;
  color: #000;
  font-weight: 300;
  cursor: pointer;
  width: 36px;
  height: 36px;
  -webkit-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  background-color: #ffffff;
  text-align: center;
  line-height: 30px;
  border-radius: 50%;
}

Answer №1

I encountered a similar problem where my IOS device couldn't register clicks on buttons or icons.

To solve this issue, I experimented with using the inline attribute onclick.

For example:

<button class="button-play button-play-1" onclick="$('.video-popup-1').show();">
give this a try, it may be helpful :)

Additionally, this was the only solution that worked for me when I faced this particular problem.

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

Conceal a dataLabel for a particular series in Highcharts

Currently, I am dealing with a chart that consists of 5 series - one as columns and the other four as lines with constant values. My dilemma lies in wanting to display dataLabels for only one of those series. Despite my efforts to activate/deactivate dataL ...

How to make text in HTML and CSS stay at the bottom of a div?

I am in the process of creating a website dedicated to my "Starcraft II" clan. My goal is to have the navigation bar display the text "ALLOYE" and remain fixed at the bottom of the screen. I attempted to achieve this using the following code: vertical-alig ...

What is the best way to use a regex to filter the user's input in a Vuetify combobox and generate a chip?

I am working on implementing a restriction for a specific regex pattern while the user types in a combobox to add new chips, such as allowing only phone number chips. Complete Vue Source code: https://codesandbox.io/s/chips-so-0gp7g?file=/src/domains/ex ...

The synchronization of template stamping with the connectedCallback function

Issue Explanation It appears that there is a timing discrepancy with Polymer (2.x) when querying for nodes contained within a template element immediately after the connectedCallback() function has been executed. Ideally, the initial call of this.shadowRo ...

Define certain variables within a single document that will have an impact on others

Is there a way for me to avoid having users open a lengthy script just to make simple text changes? I am considering using variables in my index.html document to modify content in my javascript file. For instance: // index.html <script type="text/j ...

What are the best practices for dynamically handling variables in JavaScript?

I am looking to dynamically work with variables and store their references in a collection. My first question is: How can I save a variable reference (not its value) in a collection? For example: var apple = "A delicious fruit"; var banana = "A yellow f ...

What is the correct method of implementing the "OnChange" event to a WooCommerce select element?

My task is to include the onchange="myFunction()" in the select menu below. However, because the select menu is part of woocommerce, I want to ensure that the onchange="myFunction()" remains intact even after updating my theme. How can I achieve this goal ...

Attempting to retrieve exclusively the checked records in Vue.js

Currently, I am referring to this library for checkboxes. As I delve into the code, I notice how it is declared and utilized. Initially within the el-table, we have @selection-change="handleSelectionChange". They have initialized an empty array ...

"Learn how to smoothly navigate back to the top of the page after a specified amount of time has

Just starting out with JS, CSS, and Stack Overflow! I'm currently working on a div box that has the CSS property overflow: auto. Is it possible to make the box automatically scroll back to the top after a certain amount of time when the user scrolls ...

Tips for Utilizing jQuery each Loop

I am attempting to create a foreach loop that will iterate through hidden values on the page, compare them with an external API using Ajax, and display the API results in a < ul > for example. Sample model ITEM1 metavalue (which needs to be che ...

Issue with jQuery animation: Background color does not change upon scrolling

Here is my fiddle link: https://jsfiddle.net/jzhang172/owkqmtcc/5/ I am attempting to change the background color of the "content" div when scrolling anywhere within it. The goal is for the background color to change when scrolling and revert back to its ...

Sending a file using Angular's $http service

I am facing an issue while trying to upload a form with an image file using the angular $http function and multer in the background for receiving. I have successfully uploaded the image via a direct form submission (without angular) as shown below: <fo ...

Tips for efficiently combining mergeMap observables and providing a singular value for the entire observable

Consider this particular case involving TypeScript/angular with rxjs 6.5: main(){ const items = ['session', 'user']; const source: Observable<any> = from(items); source .pipe( ...

Strategies for consistently receiving updates of Iframe content body within a react useEffect hook

When loading html into an iframe using srcDoc with the sandbox="allow-same-origin", I face a challenge. Despite the content displaying properly, the property frameRef.contentDocument.body.innerHTML remains empty. This issue persists even after s ...

Creating a compact Swiper slider: reducing image size without sacrificing full window coverage!

Utilizing Swiper to craft a slider that occupies the entire window, with a slight margin for a bar-- no issues there. () However, the image I placed in for the slide () appears to be excessively enlarged. Is there a way to display more of the width of th ...

To create a distinctive design, the HTML5 wrapper will specifically enclose the Header element

After using a border, I discovered that my wrapper is only wrapping the header and not extending down to the footer. Can anyone offer some guidance on how to wrap the entire content from the header to the footer? I've come across suggestions to speci ...

When the enter key is pressed, the form will be submitted and the results will be displayed in a modal window without

Behold, my unique form! It lacks the traditional <form></form> tags. <input id="query" name="query" style="font-size: 18pt" id="text" data-email="required" type="text" placeholder="Search Here from <?php echo $row['no']."+"; ?& ...

Ways to prevent a page from scrolling

I'm currently working on a webpage that features a vertical drop-down menu. The issue I'm facing is that when the menu drops down, it causes the text below it to be pushed downwards and off the page. While this behavior is anticipated, it also tr ...

Tips for adjusting breakpoints in the SCSS of Vuetify version 2?

I am currently using scss files and I want to adjust the breakpoints within the css code in vuetify version 2. Unfortunately, I have not been able to locate any information regarding this in the vuetify upgrade guide. In the previous version 1.5, I utili ...

Encountering a 'unknown column' error while using MySQL on a Windows operating system

A query is being executed on Node.Js with MySQL, resulting in the following: SELECT COUNT(DISTINCT t.uid) AS usersCount, COUNT(*) AS workingDaysCount FROM ( SELECT d.date, u.id AS uid, CASE TIMESTAMPDIFF(day, SUBDATE(d.date, WEEKDAY(d.date) ...