Learn how to create animations in Vue.js that move components from the top to the bottom of

When hovering over the picture, I want my four components to be displayed in an animated way from top to bottom. Currently, they are displayed without any animation, making them look unappealing.

Each of the four pictures triggers the display of a corresponding component upon hover. For example, hovering over the first picture shows the first component, and so on.


    <div class="EnjoyGirlsList">

      /* Code for displaying different components on hover */

    </div>
  </div>

  <div class="EnjoyGirlsHoverEffect">
    /* Components that are shown based on hover events */
  </div>

/* Vue.js component setup */

export default {
  name: "HomePage",
  components: {EnjoyRed, EnjoyYellow, EnjoyGreen, EnjoyBlue, Navbar, GirlsSectionList, FeaturedShows,},
  data() {
    return {
      img1: false,
      img2: false,
      img3: false,
      img4: false,
    }
  },
  methods: {
    mouseOver1: function(){
      this.img1 = true
    },
    mouseOver2: function(){
      this.img2 = true
    },
    mouseOver3: function(){
      this.img3 = true
    },
    mouseOver4: function(){
      this.img4 = true
    },
    mouseout: function() {
      this.img1 = false;
      this.img2 = false;
      this.img3 = false;
      this.img4 = false;
    }
  }
}

Answer №1

  <div style="margin-top: 50px;">
    <slide-y-up-transition>
    <RedExperience v-show="img1"  />
    </slide-y-up-transition>
    <slide-y-up-transition>
      <OrangeExperience v-show="img2" />
    </slide-y-up-transition>
    <slide-y-up-transition>
      <GreenExperience v-show="img4" />
    </slide-y-up-transition>
    <slide-y-up-transition>
      <BlueExperience v-show="img3" />
    </slide-y-up-transition>
  </div>

import {SlideYUpTransition} from 'vue2-transitions'
  components: {SlideYUpTransition},

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

Suppressing FC-Title from Display in AgendaWeek and AgendaDay Views of FullCalendar

I've integrated a fullcalendar agenda in codeigniter. I'm curious as to why the fc-title isn't displaying in the agendaWeek or agendaDay views. The fc-title only appears in the month view. When inspecting the element, it seems that in the ag ...

React app fails to render on GitHub pages link

I attempted the following steps: Added a homepage to my package.json file Ran the command npm install gh-pages --save-dev Executed the command npm run deploy Upon running "npm run deploy," I received the following message: $ npm run deploy > <a ...

After toggling the switch to send the current state to the server, the React state remained unchanged

Could you clarify why the relay1 state is being sent as false? Why doesn't handleControlRelay1 change the state? Am I making a mistake by placing this inside a function? setRelay1((prevValue) => !prevValue); // ... const [relaysData, setRelaysD ...

Using PHP to generate hyperlink onclick events with jQuery

I am currently dealing with some messy PHP code that needs to be cleaned up at a later time. However, the priority now is to get the code functioning properly. Currently, the post command is not executing, meaning that the script find.php is not being ru ...

Exploring and Presenting Database Findings (PHP MySQL) in a Format Beyond Traditional Tables in HTML

My code is functioning as intended, where a search is performed in the table based on user input, displaying the attributes within an HTML table. For a clearer picture, I will provide an image of the search output: Output of the Search However, due to the ...

Tips on successfully passing multiple keys and their associated HTML tag attributes in a React application

One of my links, specified with an a-tag, appears in this manner: <a href={ item.htmlReportUrl } target="_blank" rel="noopener noreferrer"> {item.htmlReportText}</a> The values for the href and the linktext are sourced from the following: ro ...

Sending a string to the server-side using Jquery Ajax

Is there a way to send variable data to the server side? I am looking for a solution. $("form").submit(function () { GetSelectedValues(); }); function GetSelectedValues() { var data = $("#DDL_WorkCategory").val(); } This ...

Issue with Three.js CanvasRenderer not displaying Mesh when using multiple materials

Encountering an issue with CanvasRenderer not rendering a Mesh that has multiple materials applied to a BoxBufferGeometry. The Mesh appears without any materials when using CanvasRenderer, but works as expected with WebGLRenderer. Check out the example co ...

Obtain the selected option's value using Angular

Having an issue with my user.model.ts file. I have a list of users that I can edit by clicking on a button that filters the user's data and puts it in a bootstrap modal. I'm using [ngModel] in a select tag to get the country of my user, but when ...

Converting JavaScript matrices to Python

Currently enrolled in a challenging mathematics and computing course, I am faced with an interesting programming problem. The task at hand is to write a program that can store the contents of a 6 by 6 matrix. In this defined matrix M, the value of each cel ...

Using JavaScript to create delays for a group of setTimeout functions

I have a collection of items that need to be shown at various intervals using the setTimeout() function in JavaScript. What I attempted was to create a loop where, for each item, I set up a setTimeout event individually. This is the code snippet I used to ...

Tips for ensuring a document stays at the top of my collection when performing an update

Whenever I make changes to a document, it always ends up at the bottom of my collection. Is there a way to prevent this from happening? try { await Card.update({_id: fixedUrl}, {$push:{'comments': data}}) } catch (err) { console.log(err ...

Tips for maintaining the dimensions of Google chart columns while also implementing a scroll bar

I am working on a Google chart that will be generated through a database search to populate it. However, I have encountered an issue where if there are too many columns (representing different companies in my case), the size of the column bars keeps shrink ...

The operation of "grunt build" results in a Lexer Error, causing the ng-include

After deploying my unminified code successfully, I proceed to run grunt build and deploy from the dist folder. However, upon checking one of the pages, I encounter a breakage with an error in the console: Error: [$parse:lexerr] Lexer Error: Unexpected nex ...

Error: An unexpected token '<' was encountered during the React Webpack build process

My ReactJs project is using Webpack4 and @babel/core 7. However, when I attempt to build the project, I encounter the following error in the terminal: ERROR in ./src/views/Pages/Login/Login.js Module build failed (from ./node_modules/babel-loader/lib ...

Tips for eliminating nested switchMaps with early returns

In my project, I have implemented 3 different endpoints that return upcoming, current, and past events. The requirement is to display only the event that is the farthest in the future without making unnecessary calls to all endpoints at once. To achieve th ...

"Why is it that when using jQuery, the .fail method doesn't accept arguments to deliberately

I am attempting to utilize custom JSON encoded data after intentionally triggering an error on the server (throwing an error on purpose) during a jQuery AJAX request. I am confused as to what is going wrong, as the header is correct and the data is being ...

The issue of WithRouter Replace Component not functioning in React-Router-V6 has been encountered

As I upgrade react router to react router v6, I have encountered a problem with the withRouter method which is no longer supported. To address this issue, I have created a wrapper as a substitute. export const withRouter = Component => { const Wrappe ...

Conceal navigation buttons on the first and last pages of the slider

I'm attempting to develop a slider that hides the "previous" button when it is on the first slide and hides the "next" button when it reaches the last slide. The slider will be created using a combination of PHP, forms, and JavaScript. Below is the H ...

What is the best way to include React globally when running unit tests?

In my Rails project, I have integrated the react-rails gem, which sets up a global variable like this: window.React = React; While this is convenient for regular usage, it causes issues when running unit tests with Jest because the global React variable ...