How come using background-size: cover; causes my jquery animation to lag?

I've been having trouble figuring out why the jQuery animation on a website I just started working on was moving so slowly.. It turns out that it has something to do with background-size:cover being applied to a large background image on the body tag.

The slow performance is only happening in Firefox, it works fine in safari and chrome. I even tried disabling all add-ons but it doesn't seem like any of them are causing issues.

When I turn off background-size in firebug, my jQuery slideDown effects work smoothly. But when I turn it back on, they become much jerkier. The same thing happens when I try animating using CSS3 transitions instead.

Does anyone have any ideas why the background-size property is impacting the animations?

The specific page in question is located at: If you hover over any of the boxes in the right hand column, you should see the animation.

Answer №1

Perhaps the reason for this issue is due to the extra computations required for background-size:cover to display correctly.

Take a look at this explanation detailing what must be done for it to function properly.

cover

Indicates that the background image should be resized to the smallest size possible while ensuring that both dimensions are equal to or greater than those of the area where the background is positioned.

https://developer.mozilla.org/en/CSS/background-size

This is just speculation, but could it be that Firefox's engine struggles with this particular feature?

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

In JavaScript, generate a distinct array element for each nested item while removing duplicated parent properties

I want to transform a dataset similar to the one shown below [ { "suburb":"Collingwood", "couples":[ { "husband":"Adam", "wife":"Brittany" }, { "husband":"Dave", ...

Turn off specific bound functions temporarily using jQuery

In the scenario where a field is focused or blurred, a jQuery Ajax request is triggered. I want to prevent the Ajax request from firing if there's already an ongoing request. The code snippet below illustrates my current approach: $('#do ...

Using PHP, dynamic webpage content is displayed on top of a Navigation Bar

I needed a Navigation Bar that would be consistent across all webpages, so I decided to create a file called Header.html and use <?php include('Includes/Header.html') ?> in all of my webpages to easily add the Navbar/Header to the top of ea ...

Transforming JSON output into a string without any prior understanding

My AJAX function generates a JSON output which also includes unnecessary XML due to an error in the JSON WebService. To remove this XML, I have utilized JavaScript Regular Expressions. AJAX Function function setJsonSer() { var strWsUrl = 'https: ...

The version of selenium-java-2.43.0 is not compatible with Firefox 36

After successfully running my tests with "selenium-java-2.43.0" on Firefox 33, I encountered an issue when Firefox updated to version 36. The web browser was unable to load the page. Should I consider upgrading to selenium-java-2.4x.0? ...

"The issue with the jQuery pop-up box overlay persisting and not closing

I have implemented a jQuery popup plugin on my WordPress site, and while the popup functions correctly, I am facing an issue with the styling. The design does not include an overlay to grey out the background, so I attempted to add classes and styles to th ...

The radio button's functionality for clicking does not function properly in Internet Explorer

My issue is causing frustration, and despite my efforts, I can't seem to find a solution. The problem arises when calling this partial view from two different pages: <div id="NotificationStatusSuspensionDiv"> <p> <str ...

Adjust the background color dynamically with jQuery as the value changes

Not too long ago, I was working on a solo project for a simple web page and encountered a challenge. I wanted to modify the background-color of a specific cell when its value changed. If the value is 0, then it should display white. For any other value, ...

Issue with jQuery's outerHeight() function persisting despite attempting to fix it with jQuery(window).load()

Once the content is loaded using AJAX, I need to retrieve the outerHeight of the loaded elements. Ajaxload file: $('#workshop').submit(function(event){ $.ajax({ url: URL, type: 'POST', data: $(' ...

Combining JS Files

In our custom WP Theme, we incorporate Twitter Bootstrap, Font Awesome PRO (SVG), and JQuery. We are considering concatenating these .js files together in one minified file to reduce the number of page asset requests on load. Is there any concern with co ...

Inserting data into a Textbox by clicking on a Div

I'm currently working on creating a wallpaper changer for my website. Right now, I'm looking to input the URL of a wallpaper into a text box when the corresponding DIV option in a CSS menu is clicked. Below is the JQuery I am using: $("div.bg8 ...

Switching the placement of my menu bar to the other side of my logo

Can anyone help me figure out how to move my menu bar to the opposite side of my logo? I attempted using the position relative in CSS but it didn't reposition correctly. I've included the position:relative in the CSS code of my HTML index file, ...

Drop-down and autocomplete feature in Material UI design framework

Encountering an issue with aligning a label with a dropdown in material UI, and for some reason, this behavior is observed: https://i.sstatic.net/n7pj8.png Struggling to get them aligned on the same row. This is the code snippet of my component: const us ...

Subsequent modal forms do not trigger Ajax responses

I have a list of items displayed on a page, with each item having a link that opens a unique modal. Inside this modal, there is a text field for entering a username and an AJAX call to display usernames when "@" is typed (pretty cool, right?). The issue I& ...

Scroll sideways with AJAX content replacement

I've successfully discovered various methods for loading and replacing content with ajax, as well as ways to hide/show with effects. However, I'm now seeking a technique that allows the new content to slide into a div while the old content slide ...

Toggle textboxes using jQuery depending on the radio button choice

I'm trying to make specific textboxes appear when a particular radio button is clicked on my form, but I want them to remain hidden otherwise. Here's an example of what I've implemented: HTML: Radio buttons: <p>Show textboxes<inpu ...

When viewed on a mobile device, the entire HTML document is resized to occupy less than half of the

Whenever I adjust the size of my webpage on different devices or mobile phones, I notice that the <div> tag appears to be only half (or even less) the width of the page. This gap seems to increase as the window size decreases. Refer to the screenshot ...

Switch up the animation direction after the vimeo video finishes playing

My video module has a splash screen that reveals a full-screen video when clicked for screen sizes 667+. I want to reverse the animation after the video ends and return to the splash screen. I'm unsure of how to approach this or if it's even poss ...

What is the best way to set values for the outcomes of a jQuery/AJAX post?

When sending data to a php page using jquery, I aim to receive the response from the page and store it in php variables on the original page without displaying results in the HTML or appending a DIV. Here's an example of how this can be achieved: Sam ...

When a user taps on a link or anchor within a specific webpage on an iPhone, the font size will automatically increase

The issue is specific to iPhones. I have tested it on an iPhone 5 (landscape mode) and an iPhone 4s (landscape mode). For a visual demonstration, you can view the video here. I attempted to fix the problem by specifying the font size, but unfortunately, ...