Designing a smooth transition effect when switching between two distinct pages

I've been working on designing a website that includes a welcome page before users enter the main site. When visitors click the enter button, the initial page slides up and the new page emerges from underneath.

Here's an example of what I'm aiming for: .

If you click the enter button on that site, you'll see a smooth transition to a different page (notice the URL change). That's the effect I want to achieve.

So far, I've experimented with various plugins like animsition but haven't had much luck. My latest attempt involved using iframes, although it does not update the URL.

Here is my latest attempt:

HTML

<a id="myLink" href="#">
    Click to slide in new page
</a>

<iframe id="newPage" src="https://jsfiddle.net/"></iframe>

CSS

#myLink {
    position: absolute;
}

iframe {
    width: 100%;
    height: 100%;
    top: 100%;    
    position: fixed;
    background-color: blue;
}

JQuery

$(document).ready(function() {
    $('#myLink').click(function() {
        $('#newPage').transition({top: '0%' });
    });
});

Answer №1

If you're looking for a solution to your problem, here's one idea...

Try using the

<meta http-equiv="Page-Enter" content="revealTrans(Duration=2.0,Transition=12)">
tag within the head section.

There are over 20 transition effects available, such as:

0       Rectangle towards centre
1       Rectangle from centre outwards
2       Circle towards centre
3       Circle from centre outwards
4       Horizontal wipe from bottom to top
5       Horizontal wipe from top to bottom
6       Vertical wipe from left to right
7       Vertical wipe from right to left
8       Vertical Blinds from left to right
9       Horizontal blinds ftom top to bottom
10      Box Blinds from left to right
11      Box Blinds from top to bottom
12      Pixel Fade
13      Vertical Window Opening from middle to sides
14      Vertical Window Closing from sides to middle
15      Horizontal Window Opening from middle to top/bottom
16      Horizontal Window Closing from top/bottom to middle
17      Diagonal: bottom right to top left
18      Diagonal: top right to bottom left
19      Diagonal: bottom left to top right
20      Diagonal: top left to bottom right
21      Vertical Line Fade
22      Horizontal Line Fade
23      Random

Keep in mind that not all browsers support these transitions, so they may not be the best choice for design purposes.

I hope this information proves helpful to you.

Answer №2

The webpage you referenced utilizes the History API, which enables the modification of URL addresses without reloading the entire page. To achieve this, you should:

  1. Intercept the click event and load new content using AJAX
  2. Animate the transition to display the updated content
  3. Utilize the History API to update the address bar accordingly

I recommend utilizing smoothState.js (a jQuery plugin) as it automates these tasks for you.

Note: Using iframes is not recommended as they serve a different purpose altogether.

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

Display or conceal several buttons using ReactJS

Currently, I am working on implementing a feature in ReactJS that involves showing and hiding different buttons for multiple view options, but I have hit a roadblock. Specifically, my task involves executing queries based on user input using reactJS. My g ...

Event triggered when an image is loaded in AngularJS

Hey everyone, I need some help with my AngularJS code that should display an image when a checkbox is clicked. This is the HTML code where checkboxes are generated: <li ng-repeat="Dep in oDep" > <input type="checkbox" ng-model="cboxDepState ...

jquery is in motion while svg paths are at a standstill, waiting to

i have been attempting to incorporate a css-animated svg into my project. initially, the animation would start automatically, which was undesirable. after some research, i discovered that by declaring it as paused and then triggering it using jQuery with $ ...

My script works perfectly during $(document).ready(function() execution on a local server, but encounters issues when run

I am facing an issue with my $(document).ready(function() code that only seems to work locally. I'm not sure what the problem is, but here is an example of the code. Thank you for any assistance. <a href="#"><img src=images/folder_icon.png i ...

Refrain from showing content beneath a certain element

Is there a way to hide all content that appears after a specific element, such as a particular class of div? The issue I am facing involves using a 1&1 webpage builder with a restrictive layout-template enforced by my boss. I am trying to remove the foote ...

How can I move the cursor to the end of the email text in IE9?

There is a button with text that is specifically used in IE9. Clicking the button opens an email pop-up with a subject and body line. However, when the email opens, the mouse cursor gets stuck at the beginning of the body text. I would like it to start sev ...

Objects beyond a distance of 1 unit start to vanish when employing ArrayCamera

After implementing an ArrayCamera to wrap my PerspectiveCamera, I noticed that objects located more than 1 unit away from the origin point (0,0,0) appear to vanish in the render. var camera = new THREE.PerspectiveCamera(); camera.viewport = new THREE.Vecto ...

Implementing jqxEditorModule into an Angular 8 project

Trying to implement the Angular HTML Editor by using the guidelines provided in this link: https://www.jqwidgets.com/angular/angular-editor/angular-editor-defaultfunctionality.htm Encountering an error specifically on: import * as jqxEditorModule from &a ...

JavaScript: Efficiently Sorting a Multidimensional Array

Here is the array that needs to be sorted based on the third item: const array = [ [1, "Convention Hall", "Mumbai", 10, "XYZ Company"], [2, "Auditorium", "Delhi", 10, "ABC Company"], [3, "CenterHall", "Bangalore", 10, "ZZZ Company"], ... ...

Removing an object from a JSON array based on checkbox selection in Angular 4

0: CategoryId: "31b7a227-9fda-4d14-8e1f-1dee5beeccb4" Code: "GMA0300" Description: "PA-5215: Renamed" Enabled: true Favorite: false Id: "26cfdb68-ef69-4df0-b4dc-5b9c6501b0dd" InstrumentType: null Moniker: "1GMA0300" Name: "Celiac Disease Panel (tTG IgG, tT ...

The react-redux developer tool appears to be disabled and is not displaying the current state of the application on the extension toolbar

Just finished the redux-tutorial and attempting to view the state in the redux-devtools. However, the redux-devtools seems to be inactive on the extensions bar. Upon clicking it, a menu appears with options like "to right, to left etc". Selecting one of ...

In order to extract a value from a different webpage, I must first make a request to that webpage and extract the XML value from it

I have been working on a project that requires displaying currency exchange rates. To achieve this, I initially tried using AngularJS to call another webpage for the exchange rate values, but I encountered issues as AngularJS can only make JSON/Rest URL ca ...

Validating Firebase data for null values

Hey there, I'm currently working on a simple coding project but seems to be encountering some roadblocks. The main objective of the code is to determine if a username exists in the system or not. Here's a snippet of the data structure and codes ...

When the 'keyup' event is detected, trigger the function only on keyup

Looking for assistance in setting this to only trigger on keyup events. Can anyone provide guidance? $(function() { $('#acf-field_5a32085c7df98-field_5a3208f87df99').on('keyup', function() { $('#link-headline-fb').text($( ...

What is the best way to shift an icon to the right?

How can I position the icon to the right? <Grid container justify="space-between" border="1px"> <Typography variant="h6" className="locationTitle" display="block"> example text ...

Display additional inputs using the PHP Foreach Loop depending on the selection made

I have a PHP Foreach loop that includes a "Quantity" input field. When users select a quantity, the corresponding number of new inputs should be displayed. For example, if the user chooses a quantity of "3", then 3 new inputs should appear for that item. K ...

Performance problems with Kinetic JS in Chrome and Opera

My Kinetic JS app is experiencing significant performance issues when using Chrome or Opera browsers, but runs smoothly on IE or Firefox. You can check out the app here and view the JavaScript code here. I am currently using free hosting - could this be t ...

Concealing other items in an array on selecting one item in React Native- A step-by-step guide

Currently, I have set up my view to display an array of items (Circle components) as shown in the image below: However, I am facing a challenge in hiding all other Circle components when I click on one of them. The onPress event is configured to zoom in a ...

Guide to adding content at a particular location using the ACE Editor from within an Angular Controller

I am currently developing a real-time collaborative editor using the Ace editor library, but I am facing challenges with inserting text at a specific position within the editor. Specifically, I am looking to insert text at the cursor position when the use ...

Creating Links with Node.js and Express

Is it possible to create a custom script endpoint URL using Express? var express = require('express'); var router = express.Router(); router.get('/', function(req, res, next) { res.sendFile('custom-script.js'); }); modu ...