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

Plugin for creating custom dropdown menus using JQuery

Recently stumbled upon a new JQuery plugin for Dropdown menus, but struggling to figure out how to use it without any documentation provided. Here is the link to check it out: http://code.google.com/p/jqueryselectcombo/ Are there any alternative free plug ...

The issue with viewing next/image properly only occurs on desktops using a responsive layout. I would like for the image

<Image src={APIImagePath} alt={t("common:tokens")} layout="fill" className={styles.img} /> Showing on a desktop screen: https://i.stack.imgur.com/gT2ZF.png Viewing on a tablet: https://i.stack.imgur.com/yeABR.png ...

The method of inserting a JSON dates object to deactivate specific days

I am currently utilizing a date picker component that can be found at the following link: While attempting to use the disabledDays section below, I have encountered an issue where I am unable to apply all three options. The blockedDatesData option works o ...

Cover any HTML element with a translucent overlay box

I have a unique problem with an HTML file that is out of my control when it comes to its content. My only option is to inject a CSS file and/or JavaScript (potentially using libraries like jQuery) into the mix. Within this HTML, there are elements that re ...

Load CSS styles once the HTML content has been generated by the PHP script

One way to dynamically add a section of HTML during page load is by making use of PHP in the index.php file: In your index.php file, you can include a section like this: <html> <head> <link href="css/style.css" rel="stylesheet"> ...

Leveraging AngularJS html5mode in conjunction with express.js

Client-side: when("/page/:id", { templateUrl: "partials/note-tpl.html", controller : "AppPageController" }); $locationProvider.html5Mode( true ); Html: <a ng-href="/page/{{Page._id}}">{{Page.name}}</a> Server-side: app.use("/pag ...

Utilizing JSON for live population of search filter results

I'm currently developing a search function for my website that will sift through a JSON Object using regular expressions. My goal is to have the results displayed in real time as the user types, similar to how Google shows search suggestions. However ...

Is the AngularJS Date property model sending an incorrect value to the server?

There are some puzzling things I am trying to figure out. When using datetimepicker, the Date and time selected appear correctly on the screenshot. The value in the textbox is accurate The model's value in console is correct (but hold on a second... ...

Error message: The module '@project-serum/anchor' does not export the object 'AnchorProvider' as intended

I encountered an issue while attempting to run my react application. The issue: Attempted import error: 'AnchorProvider' is not exported from '@project-serum/anchor'. The import declaration in my code: import idl from './idl.json ...

Does writing JavaScript code that is easier to understand make it run slower?

While browsing the web, I stumbled upon this neat JavaScript program (found on Khan Academy) created by another user: /*vars*/ frameRate(0); var Sz=100; var particles=1000; scale(400/Sz); var points=[[floor(Sz/2),floor(Sz/2),false]]; for(var i=0;i<part ...

Steps for extracting URL parameters from AWS API Gateway and passing them to a lambda function

After successfully setting up my API gateway and connecting it to my lambda function, I specified the URL as {id} with the intention of passing this parameter into the lambda. Despite numerous attempts using both the default template and a custom one for ...

Send a form to two different servers

I am looking for a solution to submit forms to two different servers simultaneously. Here is the situation and challenge I am facing. Currently, I have an iframe embedded on Mechanical Turk which contains a form. When a worker submits this form, there are ...

Integrating blade code within blade code

Struggling to craft a button using the Form builder. {!! Form::button('<span style="color: {!! $colour[$i] !!}" class..') !!} The specific details of the button don't matter, all I wanted was to adjust the font color to $colour[$id]. Th ...

Error message: "React Component not identified"

I am following [this React tutorial][1] and facing an issue right from the start as my React components are not being identified. Here is a snippet of my code: import React from 'react'; import {BrowserRouter as Router, Route, Routes} from "react ...

There was an error during module build process: ReferenceError occurred due to an unrecognized plugin "import" specified in "base" at position 0

I have encountered an error while working on my ReactJS project using create-react-app. The error arose after I added and removed a package called "react-rte". Now, every time I try to start my project, I get the following error: Error in ./src/index.js Mo ...

What is the best way to pass a div element and a variable from a Child component back to a Parent component in Next.js/React?

My goal is to create a webapp that, when an item in the list generated by the child component is clicked, displays the corresponding image in a div within the parent component. After some trial and error, I managed to generate the list in the child compone ...

Launch a new tab within the parent window, passing on variables from the parent window

Currently, I have a button that opens a new window in a new tab by using window.open("newpage.html"). In the child window, I use childVar = window.opener.parentGlobalVar to access global variables from the parent window. Now, I have been requested to open ...

Deleting entries from a selection of items in a list generated from an auto-fill textbox

I have successfully implemented an auto-complete Textbox along with a styled div underneath it. When the client selects an item from the Textbox, it appears in the div after applying CSS styling. Now, I am looking to create an event where clicking on the s ...

execute the execCommand function following an ajax request

I am currently developing a WYSIWYG editor and encountering an issue with image handling using execCommand. Here is a simplified example of my page structure: <div id="buttons_panel"><input id="img_submit" type="button"/></div> <div ...

How to align scrolling images with their scroll origin - a step by step guide

Curious to know the name of the effect where images scroll in a different orientation than the page, creating a 2D appearance. Take a look at the Google Nexus website and scroll down - do you see the effect? What is this effect called? Is it created usin ...