Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

jquery slide div from off screen

Posted on 2013-06-24
2
Medium Priority
?
1,699 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
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
Suggested Courses
Course of the Month21 days, 3 hours left to enroll

810 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