What is the method for reversing a transition?

I recently implemented a transition effect from height: 0, width: 0 to a specific width on my webpage. It's working perfectly, transitioning from the bottom left to the top right as intended. I started thinking, what if I change the float property to 'right'? Would that make the transition go from the bottom right to the top left instead? Is there a way to achieve this kind of transition?

Here is the CSS code:

.ablauftext{
    height:0;
    width:0;
    position:absolute;
    overflow:hidden;
    background-color:white;
    transition: all 1s ease;
    -webkit-transition: all 1s ease;    
    bottom:90px;
}

.active{
    height:400px;
    width:400px;    
}

And here is the JavaScript code:

$('#planung').click(function(){
    if(!$current.is('#planungtext')){
        $($current).removeClass('active');
        setTimeout(function(){$('#planungtext').addClass('active')}, 1000);
        $current = $('#planungtext');
    }
});

I have assigned IDs to my elements based on floats, so I believe additional CSS modifications are not necessary in this case.

Answer №1

The solution is up and running smoothly. All it took was to include the correct position as shown below:

.yourdiv{
   right:anyamount;
}

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

Is there a way to alter the background image of the logo specifically for mobile device viewing?

Here is a snippet of my HTML code: <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="{{ route('home') }}"> <img src="{{ asset('assets/images/logo-school-icon.png') }}" ...

Changing the color of the font in your Bootstrap Navbar 3.4.1

Hello, I'm looking to customize the font color of the links in my Bootstrap navbar. I've attempted to apply specific classes to the navbar as suggested in related posts, but so far I've only been successful in changing the font of the navbar ...

If the div is devoid of content, then remove the class

<div class="slider">content goes here</div> <div id="slider-2" class="active inactive">also some content here</div> <script type="text/javascript"> function checkEmpty( element ){ return !$.trim(element.html()) ...

Tips for reducing the size of the ValidationMessage string in Blazor

Exploring the world of Blazor for my new project, I find myself faced with a challenge. My page is filled with text input fields that need to be validated upon submission. As the page shrinks into a column format on smaller screens, some validation messa ...

Is there a way to dynamically adjust a node's rotation using both jQuery and vanilla JavaScript, incorporating the transform property rotate(30deg)?

1. When aiming to support as many browsers as possible, which of the following is the optimal choice?: -webkit-transform: rotate(30deg); -moz-transform: rotate(30deg); -ms-transform: rotate(30deg); -o-transform: rotate(30deg); transform: rotate(30deg); ...

How can one prevent the buttons on another URL from opening by using Iframe?

Currently, I am utilizing an iframe to access another web service. The issue is that when users navigate to the targeted link, they can see the entire navigation menu. My goal is to restrict users from viewing the complete navigation menu. The targeted UR ...

How can I align a sub-submenu horizontally using CSS?

I've built a nested menu using the ul/li tags, and I'm looking to align the second and third sub-menus horizontally with the first submenu. Here is my current visual layout: https://i.sstatic.net/4TctL.png, and this is what I want it to look lik ...

CSS Hue Rotate is causing the image to appear darker

The CSS filter hue-rotate seems to be darkening my image according to my observations. For an example, visit: https://jsfiddle.net/m4xy3zrn/ Comparing images with and without the filter applied, it’s clear that the filtered one appears much darker than ...

Tips for organizing the data you have collected from the table

After successfully printing all the data from my database, I am facing a challenge in designing my data effectively. The table I am working with is called post_tbl and it has columns named post_id, post_message, and post_date. This is the query I am usin ...

Is it possible to apply the box-shadow effect only to the left and right sides of a div?

Looking to achieve a box shadow effect on just the left and right sides of a div? box-shadow: 0px 0 20px rgba(0,0,0,.4); I experimented with variations like: box-shadow: 0, foo, 0, foo; but it did not yield the desired results. In the illustration bel ...

What causes the difference in behavior of 'flex-grow' between Chrome and Firefox/Edge?

Trying to create a webpage with a fixed height 'header' div followed by a 'content' div below it. The content div contains various other divs with actual page content, generating dynamically through PHP resulting in varying heights for ...

Selecting Child Elements in CSS

Suppose I have the below HTML structure: <div id="div1"> .... <span class="innercontents">...</span> .... </div> Is it possible to target only the child elements of a specific parent ID? For example, could I use this CSS rule? # ...

What is the best way to reduce the viewport size of my application to 67% of the Chrome browser view?

Recently, I acquired an Angular application that comes with hundreds of SCSS files. However, when the application is viewed in a browser set to 100%, it appears ugly and too zoomed in. Applying zoom: 70%; to the index.html body improves the appearance, bu ...

Text area with a set height and expandable max-height - scrollable overflow

http://codepen.io/africanmatt/pen/IcGpa .text { max-height: 0; overflow-y: auto; transition: all .45s ease-in-out; } .text-active { max-height: 50%; } I am looking for a way to resize the .text component's max-height so that it adjusts prop ...

Choosing CSS and jQuery with the <select> element

Having trouble with jQuery and css. Looking to display div with id login-alert when an option is selected from a dropdown list. Attempted code below, but no success. Need some assistance in figuring out what's missing. <script> $('.menu op ...

What is causing the unexpected expansion of the initial column in this table?

Can you figure out why the first column in this sample table is so much wider than the others? <html> <head> <style type="text/css"> table,th, td,{ width:100%; border: 4px solid; border-collapse:collapse; ...

Ensure that the input group is entirely visible and does not wrap within a table cell

I am facing an issue with an input group placed in a table cell where the button wraps below a certain size. I want to prevent this behavior specifically for this table cell and the rest of the column. The relevant html generated with added javascript elem ...

Hover effect triggered upon mouse exit

As I delve into learning the basics of HTML and CSS, I came across the :hover property in CSS. This unique feature allows for a specific action to occur when the cursor hovers over an element, based on the code provided. Additionally, I discovered the tran ...

How can I modify the color scheme of radio buttons to include a variety of different hues?

Is there a way to customize the colors of my radio buttons with three different options? I want numbers 1, 2, and 3 to be red, number 4 to be orange, and number 5 to be green... Here is the code I am using: /* Option 1 */ input[type='radio'] { ...

Bootstrap 4 - How to Properly Align Text within Lists

Recently, I started experimenting with Bootstrap 4 and encountered an issue with centering text in a list-group. In Bootstrap 3, the following CSS rule worked like a charm: .list-con { text-align:center; } However, in Bootstrap 4, the text-align prope ...