473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Firing jQuery function to run at same time as a CSS3 animation

97 64KB
I'm trying to make a page transition and I've got a CSS3 animation that works well enough. This one:

Expand|Select|Wrap|Line Numbers
  1. @keyframes myfadeInAnimation {
  2. from { -webkit-transform: translateY(1000px); transform: translateY(1000px); }
  3. to { -webkit-transform: translateY(10px); transform: translateY(10px); }
  4. }
  5.  
  6. section{
  7. -webkit-animation: myfadeInAnimation .9s ease-in-out both;
  8. animation: myfadeInAnimation .9s ease-in-out both;
  9. }
  10.  
But it makes the current page disappear before the animation runs, so I'm trying to make a little jQuery function to make the current page fade out, so that it will appear to remain there until the new page slides in.

This jQuery function isn't doing anything:

Expand|Select|Wrap|Line Numbers
  1. $(window).unload(function() {
  2.     event.preventDefault();
  3.     linkLocation = this.href;
  4.     $("section").fadeOut(4000, redirectPage);      
  5.  
  6.     function redirectPage() {
  7.         window.location = linkLocation;
  8.     }
  9. });
  10.  
Do I need ajax, or something?
Nov 4 '15 #1

✓ answered by tdrsam

The solution I found for this was to use a plugin instead of making a custom function.

1 1147
tdrsam
97 64KB
The solution I found for this was to use a plugin instead of making a custom function.
Nov 5 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: bart_nessux | last post by:
I need a script to call several functions at the same time. How does one call more than one function simultaneously?
0
by: comp.lang.php | last post by:
I have a form that when you click the "Generate Report" submit button, it will force download a CSV file, required for this project. On the very same page you also have a "Search" submit button,...
1
by: abhi81 | last post by:
Hello All, I have a table on which I have created a insert,Update and a Delete trigger. All these triggers write a entry to another audit table with the unique key for each table and the timestamp....
0
by: magnolia | last post by:
i created a trigger that will record the changes made to a table .everything works fine except the insert query.whenerever i try to insert a record it fires insert and update triger at the same time...
2
by: whitethomas12 | last post by:
Hi, I currently have some basic code that allows me to run the tracert command through VB.NET and it also updates my database based on the results. I was wondering if someone can help me...
7
by: Amirallia | last post by:
Hi, I consume my webservice with the IE browser and all is ok when I call it with one browser. But when I call it a the same time with two browsers, the IE page tells me that the apllication...
1
by: ziycon | last post by:
I have data being loaded on a page using the jquery .load() function which calls a php script and is working grand. I have pagination added to the data loaded onto the page but no jquery functions...
0
by: Sumaima | last post by:
down vote favorite Animate the headings of a slider in a loop at the same time. Hi All, I want to animate 3 headings at the same time with some delay but I am having problem to doing this.For...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.