When utilizing "overflow: scroll", the content on the back of a flip card appears in front on Chrome, while other browsers do not have this issue

Currently, I am in the process of creating a website on my Mac and have conducted testing on Chrome, Safari, and Firefox thus far.

This particular webpage utilizes the JQuery Flip plugin for a card that has different content on each side. Due to the variable length of the content on the back side, I am considering enclosing it within a <div> tag with either style="overflow: scroll;" or style="overflow: auto;".

An issue arises when viewing the page in the Chrome browser where the back side content appears in reverse on the front side, which is not the desired behavior. Surprisingly, this problem does not occur when using Safari or Firefox browsers.

To exemplify this issue, you can access a fiddle showcasing the problem here. Clicking on the card will trigger the flip effect. When viewed in Chrome, you will notice the reversed back content on the front side. In contrast, when checked in Safari and Firefox, everything functions as intended.

I have reached out to the author of the plugin for a potential solution but have yet to receive a response. Although I initially suspected it could be a plugin-related complication, I now believe it may be more related to how Chrome interprets the "overflow" style. My assumption is that there might be a CSS workaround, particularly connected to 3D effects, that could resolve the display issue on Chrome.

Your assistance in resolving this matter would be greatly appreciated.

PS

In a post on David Walsh Blog, Ana Tudor mentions, "Applying certain properties with specific values (like overflow: hidden) on the card element would prevent it from having 3D transformed children." This statement potentially sheds light on why the effect fails on Chrome, though it remains unclear why it operates smoothly on Safari and Firefox. Unfortunately, no definitive solution has been provided, and reaching out to either Walsh or Tudor seems challenging.

Answer №1

To ensure the front and back elements are not transparent, make sure to assign a background color to both of them.

Tested on various devices including desktop and mobile

Check out the Demo

http://jsfiddle.net/xyvKjn3q/

CSS Code Example

.front, .back  {
 background-color: coral;
  color: black;
}

Answer №2

It seems like there is a unique bug that only affects OS X systems. The issue with scrolling overflow causing problems is quite puzzling, but fortunately, I discovered a simple workaround.

To fix the problem, try applying the backface-visibility: hidden property to the scrolling element. You may also use the inherit keyword depending on your specific case.

See below for a functional demo on JSFiddle:

#card .back > div {
    backface-visibility: inherit;
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdn.rawgit.com/nnattawat/flip/v1.0.14/dist/jquery.flip.min.js"></script>
<script>
    $(function() {
        $("#card").flip({
            trigger: 'click'
        });
    });
</script>
<div id="card" style="width: 300px; height: 200px; margin: 10px;">
    <div class="front" style="border: 1px solid; padding: 10px;">
        Content for FRONT of card
    </div>
    <div class="back" style="border: 1px solid; padding: 10px;">
        <div style="height: 170px; overflow: scroll;">
            Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>Content for BACK of card
            <br>
        </div>
        <div style="margin-top: 10px;">Footer</div>
    </div>
</div>

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

Utilizing Ajax Jquery for Coupon Code Integration

I am in the process of implementing a coupon code system into an existing form, but I've encountered a challenge with the current form action. <form id="apply" name="apply" method="post" action="<?php echo $editFormAction; ?>"> After ext ...

What is the best way to show the associated ul tag?

I've constructed the following HTML: <input id="<code generated id>" type="text" value="select"/> <div id="<code generated id>" class="popup"> <ul id="<code generated id>" class="none"> <li>A</li& ...

Design a big-sized button using Bootstrap framework

Is there a way to design a big, responsive button using Bootstrap? Similar to the example image linked below https://i.sstatic.net/xEBwc.png ...

Identify the moment the vertical scrollbar of the window becomes visible

Is there an effective method to reliably detect when the vertical scrollbar on a window appears or disappears? The window.onresize event does not always trigger after JavaScript DOM manipulation causes the page height to increase enough for the scrollbar ...

"Mastering jQuery: A beginner's guide to iterating through tables using

Having trouble with a clock script in jQuery that fails when looping to change the last 2 digits of the time. Currently, only one row is being updated, but I need all rows to update. Here is the code snippet: $(document).ready(function(){ var jam ...

Each jQuery function that commences with the letter X and concludes with a numeral

THE ISSUE AT HAND In my current setup, I have a series of buttons that are designed to remove individual rows from a table. However, I am now faced with the challenge of creating a function that will delete all rows within the table. Unfortunately, each r ...

How can I prevent duplicate IDs when submitting a form through AJAX within a while loop?

While submitting a form using Ajax within a while loop, I encountered an issue where the same form ID is being used multiple times due to the loop. As a result, the form only submits once. I believe that I need to generate a unique ID for each iteration of ...

Implementing Click function to selectively display a single object within a JSON array

In my JQUERY code, I've created a .each loop that iterates through data in a JSON file and populates the content into small thumbnails. When you click on a thumbnail, it should display the corresponding content on the post page. The issue I'm fa ...

Using jQuery to update a specific item in a list

My current project involves developing an Image Gallery app. It uses <img> tags within li elements. The code snippet is as follows: var $slideR_wrap = $(".slideRoller_wrapper"); var $slidesRoller = $slideR_wrap.find(".slidesRoller"); var $slideR ...

Using JavaScript to Implement Conditional Statements for Adjusting CSS Height

Check out my code snippet below: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <script src="js/jquery-1.7.2.min.js"></script> <style> div { border: 2px solid black; width: 200px; ...

What could be causing the border-collapse property to be ineffective on my HTML table?

My HTML table has nested tables, but the border collapse property is not working. Despite adding the border-collapse property to both the main table and nested tables, only the outer borders are visible, with no inside borders. <table style="bord ...

Centering text and ensuring it is the perfect size on a webpage using HTML/CSS

I am currently constructing a website as part of a class project at my school. After finalizing the design for the site, I have now moved on to the development phase. Among the various stylesheets available, I have settled on "Roboto Slab" which gives the ...

Is there a way to hide the left/right button once the scroll reaches the end of the container?

I've implemented a tab item list enclosed in a <ul> container with specified max-width and overflow-x properties causing the tab items to overflow. Below is the foundational code for the <ul> wrapper containing the mapped tab item list: ...

Avoid Refreshing the Page When Pressing the Like Button

I've been working on code for liking a post and saving the value to a database using server-side code. However, I'm running into some issues when the page refreshes after clicking the like button. I tried using event.preventDefault() in my JavaSc ...

Adaptable Design - Concealing Facebook Page Plugin at Specific Screen Widths

Can someone help me figure out how to hide the Facebook page plugin on my website? I tried using CSS but it doesn't seem to be working. Here is the code snippet: @media only screen and (max-width:800px){ .fb-page{ visibility: hidden; } This is t ...

Issue with Bootstrap dropdown menu not functioning properly [HTML]

I recently downloaded Bootstrap and included the necessary scripts in my code. However, I am facing an issue where a drop-down menu is not working properly. Despite no errors showing up in the console and everything else functioning correctly, this specifi ...

How do I resolve the issue of unable to align the element correctly?

I am struggling to create a hamburger menu icon and align it using flexbox. Unfortunately, the icon is not aligning properly as it is going beyond the menu and the browser screen with an odd top indent. Below is the code I have written: * { margin: 0 ...

What is the method for switching the parent element following the adjustment of the selected child's opacity

I am trying to find a way to use CSS to adjust the parent element's opacity if it contains a child element with a specific class. Currently, I have only been able to achieve this on hover by adding a background color to the parent element's ::aft ...

Exploring my website on Internet Explorer 8: What a disaster!

I am experiencing compatibility issues with my website on Internet Explorer while it looks great on other browsers like Chrome, Firefox, and Safari. Simply put, when I tested it using IETester, the layout was all over the place (you can compare by visiting ...

Tips for displaying only a list of folders in elfinder, a jquery file management plugin

Currently, I am working on enhancing the features of a file manager plugin that allows users to manage their folders effectively. One key functionality of the plugin is the ability for users to share specific folders with others. However, if a folder has n ...