2013-04-25 72 views
-2

動畫這裏工作,但我想移動的Facebook只有10%的頂部,留下,但它的DIS appering了,我想我留下來的動畫後,慢慢地登錄形式變淡。jQuery的動畫移動AP標籤了一定的高度

<!DOCTYPE html> 
<html> 
<head> 
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> 
</script> 
<script> 
$(document).ready(function(){ 
$("div.login").hide(); 
$("p").slideUp(1000); 
$("div.login").fadeIn(3000); 
}); 
</script> 

<style type="text/css"> 
*{margin:0; padding:0} 
html, body { 
color: #F00; 
background-color: #333; 
display: block; 
height: 100%; 
width: 100%; 
} 
.logo{width:100%; height:40%;} 
p{font-size:200%; text-align:center; padding-top:20%} 
.login{width:100%; height:60%; text-align:center;} 
</style> 
</head> 
<body> 

<div class="logo"><p>facebook</p></div> 
<div class="login"> 
    <ul> 
     <li><label for="username">Username</label><input type="text" placeholder="[email protected]" autofocus required /></li> 
     <li><label for="Password">Password</label><input type="password" placeholder="[email protected]" autofocus required /></li> 
     <li><button>Login</button></li> 
    </ul> 
</div> 
</body> 
</html> 
+0

也許不是我的問,但你爲什麼要這樣惹惱用戶?另外..隔離你的東西。不要在同一個文件中混合使用css,html和javascript。 – Jonast92 2013-04-25 22:12:40

+0

您是否嘗試爲Facebook登錄進行網絡釣魚? – 2013-04-25 22:13:37

+0

我對此表示懷疑,因爲Facebook不打擾無意義的淡入淡出(我認爲?)。 – Jonast92 2013-04-25 22:14:23

回答

0
.slide up() 

Description: Hide the matched elements with a sliding motion. 

JQuery Docs

如果我正確理解你的問題你真的想使用.animate()

$('p').animate({'top':'-50px'}, 1000); 

調整,以適應你的元素的高度