What is the best way to create a mobile app slide view using CSS and AngularJS?

After extensive research and modifications, here is the current state: view demo

.cube {
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    -o-transform-style: preserve-3d;
    transform-style: preserve-3d;
    position: absolute;
    display: inline;
}

.container1 {
    display: inline;
}

.container2 {
    display: inline;
}

.animate-enter, 
.animate-leave { 
    -webkit-transition: 1s all ;
    -moz-transition: 1s all ;
    -o-transition: 1s all ;
    transition: 1s all ;
    position: relative;
}

.animate-enter {
    left: 100%;
}
.animate-enter.animate-enter-active {
    left: 0;
}

.animate-leave {
    left: 0;
    display: inline;
}
.animate-leave.animate-leave-active {
    left: -100%;
}

1. Despite my efforts, there is still an issue where the two divs are not aligned properly. Applying "display:inline" to the .cube and .container classes didn't resolve it. I aim to have page2 appear adjacent to page1 with synchronized sliding, similar to mobile swipe transitions, without grouping them as a single block like traditional banners.

2. Currently, I've only implemented leftward slide animations for entering and leaving. How can I introduce additional sliding animations within the .cube element? For instance, having Page1 exit to the left while Page2 enters from the right. Moreover, I'd like to incorporate a button that triggers Page3 to exit to the right and Page1 to enter from the right. How can this be achieved?

Thank you.

Answer №1

element, by including floats for .container1 and .container2, we successfully address the initial issue at hand.

Answer №2

  1. By adding position:absolute to .animate-enter and position:relative to .animate-leave, the initial issue is resolved.

In addition, ensure that the containers are styled with float property. -@eRIZ

  1. Create a variable for the animation and pass a boolean value to JavaScript in order to set the animation.

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

Adjusting the spacing between buttons to accommodate the size of the page

Is there a way to dynamically adjust the spacing between 3 buttons based on screen size without changing their original size? I want the buttons to maintain their size while adjusting the space between them. Any ideas are welcome! @import url(https://fo ...

Raphael JS Path Animation: Wiping Away

I have successfully created a line animation using RaphaelJS, which can be viewed on this jsfiddle link - http://jsfiddle.net/7n040zdu/. My next challenge is to create an erasing animation that follows the initial one. This erasing animation should mimic t ...

Automobile box sliding smoothly in a horizontal motion, gliding gracefully from left to

I currently have three boxes that are functioning as expected. However, I am looking to automate this process to run every 30 seconds without requiring a 'click' event. You can refer to this fiddle http://jsfiddle.net/ykbgT/8493/. Any suggestions ...

Ways to retrieve information from a $$state object

Everytime I try to access $scope.packgs, it shows as a $$state object instead of the array of objects that I'm expecting. When I console log the response, it displays the correct data. What am I doing wrong? This is my controller: routerApp.controll ...

Organizing playing cards in a React JS application

As a beginner just starting out with React JS, I'm working on arranging cards in a medium size for my application. I came across a card design that I like and I'm seeking help to achieve something similar. Any assistance would be greatly apprecia ...

Utilizing AngularJS filter method to populate data

Just beginning my journey with Angular js, I've got this snippet of code that is responsible for binding data to the div element, app.filter("myfilter", function () { return function (data, catName) { if (angular.isArray(data) && angular ...

Is it possible to have a full-sized background image within a div element

I need assistance achieving a full-sized background image inside a div. The div is positioned as the last element on the page, and I want it to stretch to the bottom of the page. So far, my code expands the background image to the sides, but when I adjus ...

Breaking the layout using recursive components in VueJS

I am currently facing an issue where I need to dynamically load components. However, when some of these components are loaded, they appear with faulty or missing CSS styles due to a problematic first div element after the template. Removing this DIV manual ...

Creating visually appealing transition effects like sliding in an autocomplete feature can enhance the user experience and

I have successfully implemented autocomplete functionality, but now I am looking to add a transition effect (slide down) to the suggested menu. After researching online, I found a helpful tutorial on this topic: Based on the information I gathered, I tri ...

Adding and sorting div elements from an external HTML file

Greetings everyone, I have recently delved into the world of coding and am currently working on a project for my course to streamline access to information and data in my daily life. So far, I have created a single HTML file and two additional external HT ...

Is it detrimental to a page's performance when using a distinct CSS file for each individual Angular2 component?

Many Angular2 guides recommend having a separate CSS file for each component. It seems that for every custom directive, there is a need to fetch the HTML and CSS files from the server. If this results in multiple requests for multiple directives, what wi ...

Automatically Populate Text Field with the URL of the Current Page

I am hoping to automatically fill a hidden text field with the URL of the current page so that I can keep track of where form submissions are coming from. This simple solution will help me streamline my inquiry responses and save time. To clarify, upon lo ...

Leveraging a function for filtering in AngularJS

I have developed an application where the content filter changes depending on which button is clicked. I have managed to figure out the straightforward filters, but now I am attempting to create a filter that displays content within a specified range. Bel ...

Does anyone know how to position div 1 underneath div 2 using CSS?

<div class="1"> <p> THIS IS DIV 1> </p> <div class="2"> <p> THIS IS DIV 2> </p> I'm utilizing a shortcode that seems to consistently appear at the top of all elements. Is there a way to change this behavior? ...

What is the best method for preserving my outcome as an indexed array?

I currently have an empty array called cust, but the JSON data (with some metadata) has been successfully loaded, as I can see in the Chrome debugger network preview. How can I populate my array with the results so that they are indexed and accessible in ...

Explaining the process of refreshing a JWT token in Django REST connected to an Angular frontend

Currently, I am utilizing this resource: I find myself puzzled on how to implement it properly. I have followed all the specified settings. So, how can I make it function correctly? At the moment, my code retrieves the initial token when a user submits t ...

Managing scopes and directives in AngularJS with the addMore feature

I am currently working on developing a directive that includes an "Add more" button. Within the controller, I have an empty tickets object. My goal is to add new tickets (multiple) to this object when the "Add Tickets" button is clicked. Specifically, I ...

What is the method for implementing tooltips using JQuery?

AJAX call returns data for dropdown lists 'list1' and 'list2'. If there is no data available, I want to hide the dropdowns with `pointer-events: none` and display a tooltip that says "Data not available". else if (monthly_list.lengt ...

bourbon neat quadrilateral layout

Attempting to revamp someone else's messy, yet effective, CSS3 template into a more organized format. The transition to bourbon/neat has been smooth, but I'm facing a roadblock when it comes to creating a responsive image grid. <section class ...

Utilizing Node.js, AngularJS, and MongoDB to build an interactive platform for online

As I ponder the compatibility of the MEAN stack (MongoDB, Express, Angular, Node) for constructing community websites, intra and/or extranet, I can't help but wonder its ideal use case. While options like Drupal and Liferay exist, I am intrigued to e ...