Issues with Firefox's flexbox functionality are preventing it from working

Hey there, I've created a bubble menu with a button using code. It functions perfectly on Chrome but seems to have some issues on Mozilla Firefox. You can check it out and give it a try.

$(".roundedBallOuter").click(function(e) {
  $(this).toggleClass("clicked");
});
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.roundedBallOuter {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
}
.roundedBall {
  width: 200px;
  height: 200px;
  background: #ccc;
  border-radius: 100%;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}
.roundedBall:hover {
  transform: scale(1.1);
  -webkit-transform: scale(1.1);
  -ms-transform: scale(1.1);
  -moz-transform: scale(1.1);
  box-shadow: 0 0 10px #555;
  transition: all 0.3s ease;
}
.subBall {
  width: 50px;
  height: 50px;
  background: #0077ab;
  border-radius: 100%;
  position: absolute;
  transition: all 0.5s ease;
  z-index: -1;
}
.roundedBallOuter.clicked .subBall.linkedIn {
  transform: translate(-10em);
  -webkit-transform: translate(-10em);
  -moz-transform: translate(-10em);
  -ms-transform: translate(-10em);
  transition: all 0.5s ease;
}
.roundedBallOuter.clicked .subBall.facebook {
  transform: rotate(45deg) translate(-10em) rotate(-45deg);
  -webkit-transform: rotate(45deg) translate(-10em) rotate(-45deg);
  -ms-transform: rotate(45deg) translate(-10em) rotate(-45deg);
  -moz-transform: rotate(45deg) translate(-10em) rotate(-45deg);
  transition: all 0.5s ease;
}
.roundedBallOuter.clicked .subBall.twitter {
  transform: rotate(90deg) translate(-10em) rotate(-90deg);
  -webkit-transform: rotate(90deg) translate(-10em) rotate(-90deg);
  -moz-transform: rotate(90deg) translate(-10em) rotate(-90deg);
  -ms-transform: rotate(90deg) translate(-10em) rotate(-90deg);
  transition: all 0.5s ease;
}
.more {
  font-size: 20px;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  text-align: center;
}
.more>span {
  color: #0077ab;
  display: block;
  font-style: italic;
  font-size: 25px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="roundedBallOuter">
  <div class="roundedBall">
    <span class="more"><span>Click</span> for more information</span>
  </div>
  <div class="linkedIn subBall"></div>
  <div class="facebook subBall"></div>
  <div class="twitter subBall"></div>
</div>

I would really appreciate your help in fixing this bug. Thanks so much in advance!

Answer №1

You set the small balls as absolutely positioned, but you forgot to give them the exact position.

To correct this, you can set the position to where Chrome originally placed them (which is top: 75px; left: 75px;)

Here is the solution:

$(".roundedBallOuter").click(function(e) {
  $(this).toggleClass("clicked");
});
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.roundedBallOuter {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
}
.roundedBall {
  width: 200px;
  height: 200px;
  background: #ccc;
  border-radius: 100%;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}
.roundedBall:hover {
  transform: scale(1.1);
  -webkit-transform: scale(1.1);
  -ms-transform: scale(1.1);
  -moz-transform: scale(1.1);
  box-shadow: 0 0 10px #555;
  transition: all 0.3s ease;
}
.subBall {
  width: 50px;
  height: 50px;
  background: #0077ab;
  border-radius: 100%;
  position: absolute;
  transition: all 0.5s ease;
  z-index: -1;
  top: 75px;
  left: 75px;
}
.roundedBallOuter.clicked .subBall.linkedIn {
  transform: translate(-10em);
  -webkit-transform: translate(-10em);
  -moz-transform: translate(-10em);
  -ms-transform: translate(-10em);
  transition: all 0.5s ease;
}
.roundedBallOuter.clicked .subBall.facebook {
  transform: rotate(45deg) translate(-10em) rotate(-45deg);
  -webkit-transform: rotate(45deg) translate(-10em) rotate(-45deg);
  -ms-transform: rotate(45deg) translate(-10em) rotate(-45deg);
  -moz-transform: rotate(45deg) translate(-10em) rotate(-45deg);
  transition: all 0.5s ease;
}
.roundedBallOuter.clicked .subBall.twitter {
  transform: rotate(90deg) translate(-10em) rotate(-90deg);
  -webkit-transform: rotate(90deg) translate(-10em) rotate(-90deg);
  -moz-transform: rotate(90deg) translate(-10em) rotate(-90deg);
  -ms-transform: rotate(90deg) translate(-10em) rotate(-90deg);
  transition: all 0.5s ease;
}
.more {
  font-size: 20px;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  text-align: center;
}
.more>span {
  color: #0077ab;
  display: block;
  font-style: italic;
  font-size: 25px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="roundedBallOuter">
  <div class="roundedBall">
    <span class="more"><span>Click</span> for more information</span>
  </div>
  <div class="linkedIn subBall"></div>
  <div class="facebook subBall"></div>
  <div class="twitter subBall"></div>
</div>

Answer №2

Although I must admit that I have some reservations about the pixel calculation, I went ahead and implemented it anyway. Surprisingly, it accomplished what it needed to. Many thanks to everyone for your help!

    #restOfThings .subBall {
        position: absolute;
        transition: all 0.5s ease;
        z-index: 0;
        left: -webkit-calc(50% - 25px);
        left: -moz-calc(50% - 25px);
        left: calc(50% - 25px);
        top: -webkit-calc(50% - 25px);
        top: -moz-calc(50% - 25px);
        top: calc(50% - 25px);
    }

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

Once the AJAX callback is complete, the onblur event will revert back to the original field or the updated field

I am currently working with an AJAX callback: Here is the HTML snippet: <a onCLick="loadXMLDoc(id1,id2)">(Add)</a> This function triggers an AJAX method that replaces the "(Add)" text with a basic HTML input field. Subsequently, when there ...

Displaying the HTML code for a dynamically generated table

Can the generated HTML code be retrieved when dynamically creating a table using v-for loops in Vue? <table> <tr> <th colspan="99">row 1</th> </tr> <tr> <th rowspan="2">row 2< ...

What is the best way to replicate a div's background color using an image within the body element?

I am looking to achieve a layout similar to the one below: https://i.sstatic.net/1cOYw.png The dark grey color represents the sidebar, but I want to use this color as a repeating vertical image in the body element without covering the footer (light gray) ...

Incorporating a transparent icon onto an HTML background

I'm struggling to place a transparent white envelope icon on a green background. I don't understand why it's not working, especially when the telephone icon worked fine. Side Question.: Any recommendations for how to add something above the ...

Implementing a Javascript solution to eliminate the # from a URL for seamless operation without #

I am currently using the pagepiling jQuery plugin for sliding pages with anchors and it is functioning perfectly. However, I would like to have it run without displaying the '#' in the URL when clicking on a link like this: www.mysite.com/#aboutm ...

When a table has overflow set to auto, any content that exceeds its dimensions will

The issue at hand is explained in the fiddle provided. The problem arises when there is a scrollable table with a context menu inside it, and with the overflow-x: auto property set, the visibility of this "context menu" is hindered. table { overflo ...

Is there a way to make my modal appear only when the "New" option is clicked?

Is there a way to make my modal in VueJS open only when I click on the "New" option? <select v-model="input.des" @change="$refs.modalName.openModal()"> <option value="A">A</opt ...

Obtain the image format from an HTML page using the Jsoup library on Android

<div class="_jjzlb" style="padding-bottom: 55.2778%;"><img alt="AT Dam party.. #nashik #big #dam" class="_icyx7" id="pImage_11" src="https://instagram.fbom1-2.fna.fbcdn.net/t51.2885-15/e35/17438694_254543168340407_6435023364997251072_n.jpg" style ...

Prevent the page from refreshing when a value is entered

I currently have a table embedded within an HTML form that serves multiple purposes. The first column in the table displays data retrieved from a web server, while the second column allows for modifying the values before submitting them back to the server. ...

Locating a particular table without an identifier

Recently, I've started working on a selenium project and I've encountered a roadblock. The webpage I am dealing with has three tables but I only need to extract data from one specific table. The challenge lies in the fact that all tables have the ...

Integrating HTTP JSON responses into HTML using Ionic 2, Angular 2, TypeScript, and PHP: A comprehensive guide

Currently in the midst of developing my first Ionic 2 app, however, my understanding of typescript is still limited.. I aim to execute the authenticate() method within my constructor and then to: Retrieve the entire JSON response into the textarea and/o ...

Creating Spinning Text Effects in Internet Explorer with CSS

Inside a list item (<li>), I have some text that I want to rotate 270 degrees. Direct methods in FireFox, Safari, Chrome, and Opera work fine for this, but when it comes to IE, there is no direct support. I've tried using filters like matrix and ...

The v-for in Vue is not displaying the accurate text in the modal window and is only showing the data for the first item

In the process of learning Vue and Bootstrap, I am creating a blog where I want a modal window to pop up with the post information when the user clicks on the comment button. However, the issue I'm facing is that the modal only displays information fr ...

What methods can I use to streamline integration with minimal lines of code?

Seeking help with JavaScript: Recently dived into JavaScript and managed to create the desired functionality for my navigation menu. However, I suspect that my code is not optimized as I find myself repeating lines unnecessarily. Here's a snippet of ...

Issues with changing background colors using Jquery animate

I am attempting to create a fading background color effect when a button is clicked. Currently, I can change the background color using this code: $("#" + lblqty).css("background","#e9f1ff"); However, when I try to use the animate function as shown below ...

Unable to access the suggestion list within the modal

I incorporate the PrimeNG AutoComplete feature within a PrimeNG Dialog, displaying a list of elements below the AutoComplete in the dialog. My objectives are: To set the max-height of the modal dialog to 300, and have a visible scrollbar if the total ...

Revamp the md-select Container

Hello there! I'm looking for a stylish way to revamp the design of the md-select Window. Specifically, I aim to customize the background and hover effects. Despite my attempts to modify the .md-select-menu-container in CSS, it proved unsuccessful. I ...

Instructions for changing the background of a specific area to gray

Could use some assistance in changing the red area to grey, tried numerous solutions but can't figure it out. Any help would be highly appreciated! Looking to change the background to a light grey excluding the top bar and navigation. Image Current ...

What is the best way to perfectly center my CSS menu in a fluid style layout?

Can you assist me with this issue? I am trying to center my CSS menu precisely in the middle of the user's screen, both vertically and horizontally. Since users have varying screen resolutions, I need a fluid example to achieve this. Below is the HT ...

The Data from Req.Body Doesn't Appear After Adding Form Fields

I've been struggling to find a solution to this issue, but here's the gist of it: I have a button that allows users to add a question and answer pair one at a time by clicking on an "Add Question" button. This is achieved through the append featu ...