Solved

jquery slide div from off screen

Posted on 2013-06-24
2
1,524 Views
Last Modified: 2013-06-24
Hello,

I want to have the fromleft to fly/slide in from off the screen to the middle of the div after the dropdown animation is complete and the fromright to fly/slide in from the right to the middle of the div after the from left is in place

I have been tinkering with it for days but have not had any luck.

Thanks for any help,
Matt

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Banner Test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
 $(document).ready(function(){
    $('.hidden').slideDown(200);
 });
</script>
<style type="text/css">
<!--
.hidden{
	width:950px;
	height:120px;
	display:none;
	margin:0px auto;
	background-color: #333;
}
#fromright {
	padding-left:140px
}
#fromleft {
}
-->
</style>
</head>

<body>
<br />
<br />
<div class="hidden">
<div class="fromleft">Fly in from left</div>
<div class="fromright">Fly in from right</div>
</div>
</body>
</html>

Open in new window

0
Comment
Question by:movieprodw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 39272201
 $(document).ready(function(){
    $('.hidden').slideDown(200,function(){
		$('.fromleft').animate({left:'400px'},2000,function(){
			$('.fromright').animate({right:'400px'},2000);
		});
	});
 });

Open in new window


<style type="text/css">
<!--
.hidden{
      width:950px;
      height:120px;
      display:none;
      margin:0px auto;
      background-color: #333;
      position:relative;
}
.fromleft {
      position:absolute;
      left:-1000px;
      width:150px;
      height:120px;
      background-color:#def      
}
.fromright {
      position:absolute;
      right:-1000px;
      width:150px;
      height:120px;
      background-color:#fed      
}
-->
</style>
0
 
LVL 1

Author Closing Comment

by:movieprodw
ID: 39272231
Perfect!
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question