Unexpected resizing of a div due to Vue animation

I'm currently working on a quiz and I'm trying to incorporate some animation effects when users navigate between questions. I've been experimenting with a fade in and out effect, but there seems to be a glitch. Whenever I click the button, there is a split-second delay where the div expands down before shrinking back up (see image). I'm not sure what's causing this issue. Any insights would be greatly appreciated. Thank you.

<transition-group tag="div" name="QBox" mode="out-in">
  <h3 class="Q-text" :key="questionID">{{questionText}}</h3>
  <div class="option" :class="{'selected':option.selected}" v-for ="option in options" @click="nextQ(option.association)" :key="option.text"> {{option.text}} </div>
</transition-group>
.QBox-enter-active{
  animation: slide-in 1s ease;
}
@keyframes slide-in {
  0% {opacity: 0;}
  100% {opacity: 1;}
}

https://i.stack.imgur.com/SRwEC.jpg

Answer №1

.QBox-enter-active{
  opacity: 1;
    -webkit-animation: slide-in 0.7s infinite;
    -moz-animation: slide-in 0.7s infinite;
    -o-animation: slide-in 0.7s infinite;
    animation: slide-in 0.7s infinite;
}
@keyframes slide-in {
    0% {opacity: 1;}
    50% {opacity: 0.5;}
    100% {opacity: 0;}
}

Initially, the duration of the animation was not defined

Additionally, the path of the movement in your frame is ambiguous

This results in a sudden transition

Consider implementing this modification

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

Centralized and secure masthead

Currently, I am focusing on showcasing my portfolio at www.bbellmedia.com/mywork The specific requirement I have is to center the text 'Bryan Bell' and ensure that it remains fixed even when the user scrolls. Can anyone suggest the most effecti ...

Shifting Transition for Customer Reviews

I am working on implementing a testimonial slider on my webpage located at . I am trying to make it automatically slide by itself, but have been unsuccessful so far. I would appreciate if you could visit the demo page on my website and help identify what ...

The margin property in jQuery does not seem to be functioning properly when trying to send

Within the view page, there is jQuery code that sets a margin on a div. Below is the code: <script type='text/javascript'> $('#someID').css('margin-left', '10px'); </script> This code functions proper ...

Transfer information from the client to the server using AJAX and PHP by

When attempting to post a JavaScript variable called posY to a PHP file, an error occurred with the message: Notice: Undefined index: data in C:\xampp\htdocs\Heads_in_the_clouds\submitposY.php The posY variable is defined in the JavaSc ...

Integrate fresh data into an array using Vue

Exploring VUE for the first time, I am working on a project where I need to update an array by passing an object. The scenario involves two buttons named BUTTON 1 and BUTTON 2. Clicking on BUTTON 1 sets an object in the list[] using this.$set. However, whe ...

Can Vue 3 be utilized with both the composition API and vue class components?

For the past 8 months, our project has been developed using Vue 3 and the class components. However, it appears that the class components are no longer being maintained. Therefore, we have decided to gradually transition to the composition API, specificall ...

Is it possible to modify content in a Laravel post using formData?

Working on a social network, I encountered an issue when trying to enable post editing. The error message displayed is: message: "This action is unauthorized." Despite following the flow of sending data through Axios calls and defined routes to the contr ...

Issue with VeeValidate causing VueJS Mocha test case to fail

I need help writing a unit test case for the UI that uses the VeeValidate library. The code snippet of the UI is as follows: <b-card-header> <h4>Override Fields</h4> </b-card-header&g ...

What is the best way to enlarge an element when scrolling downwards within the element?

I am looking to create a div that dynamically adjusts its height based on the user's scrolling behavior. The goal is for the div to expand to the very top as the user scrolls downward, and stop when it reaches 70% of the container/parent element. Is t ...

Personalized dropdown appearance

During my work on a select box, I discovered that custom styling is not possible. I attempted to use some plugins but did not find one that met my needs. I am seeking a dropdown menu with options in both black and gray, similar to this template but using ...

What could be causing the "Cannot POST /api/" error to occur when attempting to submit a form?

Having issues with my basic website and struggling to find a solution. As a complete beginner in this field, I am stuck and need some guidance. Accessing http://localhost:3000/class/create works perfectly fine when running the server. However, trying to a ...

Box size adjusts to fit its content, including any form fields

Looking to create a box that adjusts its size based on content and center it without resorting to using tables for layout or setting fixed sizes. How can this be achieved while keeping the markup clean? I've almost got it, but the form fields are not ...

Tips for creating a captivating full-screen parallax section on your website

Is there a way to make the first section of a parallax site full screen? I've been scouring the internet for a solution to this problem, but I'm not having any luck. Almost every parallax site I come across has their first section full screen, a ...

When the only source is available, the image undergoes a transformation

Is there a way to dynamically adjust the height of an image using JQuery or JavaScript, but only when the image source is not empty? Currently, I have an image element with a fixed height, and even when there is no source for it, Chrome still reserves sp ...

Block with vertical text covering entire height

I need to place an additional block with 100% height and vertical text (bottom-to-top direction) inside a variable height block, aligning it to the left side without using width and height calculations in JS. Is there a way to achieve this using CSS transf ...

Sharing data between VueJS2 components

I am working on a project where the parent component retrieves a large JSON object from the server. My goal is to parse this data and then pass it down to the child components. The structure of the child components is as follows: <child-comp /> I ...

Automatically add a table row at the bottom displaying the overall calculation

I have data to display in an HTML table. The data is coming from a third-party server (PHP) using AJAX requests. The data is currently being displayed effectively with the following code: <table id="tbl-product"> <tr> < ...

Is it possible to run quirks mode in one frame while running standards mode in another?

Back in the IE6 days, I developed an old application that relies on frames instead of iframes and runs in quirks mode. Now, I'm wondering if it's possible to have one frame remain in quirks mode while another operates in standards mode when using ...

Vue cannot compile Window.resize

Could someone please assist me in identifying the issue with this code snippet? I copied some pure HTML from a specific website. The window resize function is showing up as incorrect syntax marked in red, but I'm not sure why. Any guidance on fixing t ...

Customizing CSS float labels for individual inputs

For my project, I've implemented CSS code to create a floating label effect for form inputs. If you need the original code reference, it can be accessed here. However, since there are multiple examples in the original codebase, I have extracted and m ...