Solved

jquery slide div from off screen

Posted on 2013-06-24
2
1,499 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Correct and Effective way to generate pdf files online via JavaScript or ASP.Net? 6 57
Wordpress Query 5 25
Button on Table, name table1 not working 4 21
Javascript 2 22
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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)

856 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