jQuery幻灯片div从屏幕外 [英] jquery slide div from off screen

查看:71
本文介绍了jQuery幻灯片div从屏幕外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望下拉动画完成后,可以让fromleft从屏幕外飞进/滑入div的中间,而fromfrom可以从屏幕右方飞出/滑入div的中间.左边就位

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.

感谢您的帮助, 马特

<!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>

推荐答案

您正在寻找jQuery的animate,可作为slideDown中的回调运行.我在这里做了一个简单的示例,但是显然它需要大量调整才能成为您想要的.

You're looking for jQuery's animate, run as a callback from the slideDown. I've done a quick example here, but it obviously needs a lot of tweaking to be what you're looking for.

http://jsfiddle.net/avQFW/

这篇关于jQuery幻灯片div从屏幕外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆