Mobile devices do not support CSS3 transition functionality

I have a straightforward div setup that smoothly transitions upward when swiped up on the screen, functioning perfectly on my desktop. However, I am encountering difficulties getting the transition to work on my mobile device (also tested on an Android emulator).

Initially, I suspected an issue with the swipe functionality (utilizing TouchSwipe), but even after testing it with a button, the transitions continue to remain inactive. Just to provide some context, this is within an Angular application and forms part of an Angular template. I don't believe there are any conflicts between these elements...

Any suggestions or insights?

HTML:

<div id="fullpage" class="swipe-container">
    <div class="section">

        <button id="btnOpen" class="btn btn-primary">Open</button>

        <div class="swipeMenu">
            Text
        </div>

    </div>
</div>

CSS:

.swipeMenu {
    height: 45vh;
    width: 90vw;
    background-color: #fff;
    position: absolute;
    bottom: -45vh;
    left: 0;
    right: 0;
    margin: 0 auto;
}

JS:

    $(function() {

        $("#btnOpen").click(function() {
        $('.swipeMenu').css("-webkit-transition", "-webkit-transform 0.3s ease");
      $('.swipeMenu').css("-moz-transition", "-moz-transform 0.3s ease");
      $('.swipeMenu').css("-o-transition", "-o-transform 0.3s ease");
      $('.swipeMenu').css("transition", "transform 0.3s ease");
      $('.swipeMenu').css("transform", "translateY(-40vh)");
        });

    //Enable swiping...
    $(".swipe-container").swipe( {
      //Generic swipe handler for all directions
      swipeUp:function(event, direction, distance, duration, fingerCount) {
        $('.swipeMenu').css("-webkit-transition", "-webkit-transform 0.3s ease");
        $('.swipeMenu').css("-moz-transition", "-moz-transform 0.3s ease");
        $('.swipeMenu').css("-o-transition", "-o-transform 0.3s ease");
        $('.swipeMenu').css("transition", "transform 0.3s ease");
        $('.swipeMenu').css("transform", "translateY(-40vh)");
      },
      swipeDown:function(event, direction, distance, duration, fingerCount) {
        $('.swipeMenu').css("-webkit-transition", "-webkit-transform 0.3s ease-in");
        $('.swipeMenu').css("-moz-transition", "-moz-transform 0.3s ease-in");
        $('.swipeMenu').css("-o-transition", "-o-transform 0.3s ease-in");
        $('.swipeMenu').css("transition", "transform 0.3s ease-in");
        $('.swipeMenu').css("transform", "translateY(40vh)");
      },
      //Default is 75px, set to 0 for demo so any distance triggers swipe
      threshold: 80
    });
  }); 

Answer №1

Consolidating all of your Javascript CSS modifications into a unified CSS class and employing jQuery's addClass function would likely be more efficient, particularly given the repeated instances of these CSS values in your code.

Furthermore, it is important to include vendor prefixes for the transform property, notably -webkit, as this could explain why the animation is failing on Android devices.

Answer №2

Avoid adding transition attributes directly to the onclick event handler! It's better practice to define them in your CSS stylesheet. Instead, handle the transformation on click using JavaScript. Please note that this suggestion has not been confirmed through testing.

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

Google Map not rendering correctly when dynamically implemented for the second time

When this specific HTML code is pasted into an .html document and opened directly in a web browser, it showcases the issue I am experiencing. <!DOCTYPE HTML> <html ng-app="myApp"> <head> <link href="https://netdna.bootstrapcdn.com/bo ...

Techniques for Extracting the Values of all ng-models within an ng-repeat Loop

How do I retrieve the total value of all ng-models within an ng-repeat loop using AngularJS? Below is my HTML code: <div ng-repeat="kind in plans.availableOptions"> <span class="payLabel text-left">{{kind.name}}</span> ...

Message displayed when autocomplete fails to provide results

Hello, I am working on a form that includes autocomplete functionality using Thymeleaf. <script type="text/javascript" th:inline="javascript"> /*<![CDATA[*/ $(function(){ var currencies = []; /*[# th:each="n : ${Locations}"]*/ currencies. ...

customize Form Modal Bootstrap with AJAX Chained Dropdown for pre-selected options

I am facing an issue with a chained dropdown on a bootstrap modal, Here is the code snippet: function changeDetail(id) { var id = id; $('#edit').prop('hidden', true); $('#modal_form').prop('hidden', fa ...

What is the best way to emphasize specific months and years in an Angular Material datepicker?

I have an array of days, which can be from any year. I am attempting to customize the Angular Material datepicker to highlight specific months and years in the selection views based on the array of days. .html <input [matDatepicker]="picker" ...

Is toastr functionality affected by bootstrap 5 updates?

I have recently updated my web app to use the latest version of Bootstrap 5 along with the toastr library. However, I have encountered issues with toastr options not functioning properly after the upgrade. Despite setting the values for toastr.options.time ...

What is the most effective way to extract data that includes an array within it?

const flightList = [{ number: 343, from: "Singapore", to: "India", upgradeTypes: ["Economy to Premium Economy", "Economy to Business Class"] }, . { number: 363, from: "Chennai", to: "Sing ...

The battle between jQuery Ajax and browser URL manipulation

I'm attempting to utilize the YouTube API to retrieve a list of a user's videos. The request URL looks like this: with 'username' representing the correct username. This displays the proper URL in the browser. However, when I t ...

Unable to make calls to functions within my JQuery prototype class

When it comes to setting up the behavior for my content_item elements, I use the following approach: $.fn.createContentItem = function() { $(this).selectItem = function() { $(".content_item").removeClass("selected"); $ ...

The Jquery UI confirmation dialog is working flawlessly on the Fiddle platform, but it is not displaying correctly on the

After testing this code snippet on a fiddle and seeing it work perfectly, I attempted to implement it on my website only to find that there is no border appearing, and the layout appears disorganized. Even after removing all the CSS styles and inspecting ...

Incorrect Pixel Width with Relative Positioning in Internet Explorer 11

I'm encountering a positioning problem that seems to be specific to Internet Explorer (11). I'm attempting to absolutely position a div tag in relation to another element. The problematic code snippet appears as follows: <div id="FacebookWra ...

Prevent uniform width for child elements in flexbox when using flex-direction column

In my navigation bar, I implemented flex with flex-direction column to stack the child elements vertically. However, I am facing an issue where all the child elements have the same width. I want each child element to have its own specific width so that I c ...

What is the best way to filter and eliminate title categories from a multi-dimensional array?

I have a list of items organized into alphabetical categories. Items that begin with the letter A are grouped together, those starting with B are in another group, and so on. When I apply a filter to this list, the category titles for each letter remain v ...

display a list of items in the dashboard using Angular 2 md-sidenav when clicked

I've successfully implemented a sidebar navigation menu in Angular 2, resembling the image shown in the link below: https://i.sstatic.net/KFvJQ.jpg UPDATE: However, I'm facing an issue where clicking on a category link within the sidebar doesn ...

Ways to condense list chart into a single item and utilize a select dropdown to display choices without the need to refresh the

As a novice in the realm of creating charts using pandas and converting them into JSON format, I am faced with the challenge of displaying numerous graphs while conserving space. I am seeking guidance on how to implement a filtering system to only show the ...

Adding a button on its own line

Is there a way to append a button with a Bootstrap class in the same line? Currently, I have this line of code that adds data to a table after successful insertion into the server: $("#id_of_my_tr").before("<tr><td>" + name + "</td>< ...

Open a fresh window using Javascript and add new content inside

After creating a script that opens a window and writes content when the button is clicked once, I noticed that clicking the button again causes the window to gain focus instead of rewriting the content. Does anyone have any ideas on how to fix this issue ...

Including extra js files disrupts the jQuery IntelliSense functionality

After enjoying the benefits of jQuery IntelliSense in VS2008, I decided to add a reference to jQuery UI. However, upon doing so, I noticed that the jQuery IntelliSense disappeared. It seems that referencing another .js file in the document causes this is ...

Is there a way to modify the spacing between labels and text in the TextBox MUI component while using custom label sizes?

https://i.sstatic.net/OvAN9.png I've customized a material ui TextField component by increasing the font size of the label. However, I'm facing an issue where the gap in the border for the label remains unchanged despite the larger text size. I ...

CSS - Incorporate the value of the counter() function as a property value

Is it possible to increment the margin-top of an element based on its index using a counter()? For example: div { margin-top: calc(counter(myCounter) * 10px); } I couldn't find any information on whether this is achievable or not. Since counters ...