当前位置:编程学习 > JS >>

jQuery 页面上的文字淡出效果

使用HTTP POST请求加载一个远程页面,测试demo.获取mailtoInfo.html里面的内容。
  undefined$.post( 字符串 加载页面的url, Hash属性和值以 "property/value" 对形式表示的 Javascript 对象 params将要传送给服务器的Key/Value对, FunctionJavascript 函数 callback当数据加载成功时被执行的方法 )
答案:<!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>
<title>jQuery Mailto 文字淡出</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<style>
.gone, .email {
display: none;
}
</style>
<script src="http://www.zzzyk.com/ajaxjs/jquery1.3.2.js"></script>
<script>
$(document).ready(function(){
$('.instructions a').click(function(){ 
$('p.instructions').html('测试demo.获取mailtoInfo.html里面的内容。');
$.post('mailtoInfo.html',{pass: "secret"},function(txt){
   $('div.email').html(txt);
   $('div.email').slideDown("slow");
});

return false;
}); 
});

</script>
</head>
<body>
<h1>Contact us</h1>
<p class="instructions"><a href="">Click here</a>.</p>
<div class="email">aaa</div>
 <br /><br />
</body>
</html>

上一个:inputSuggest在文本框输入字符时提示
下一个:JavaScript网页倒计时跳转

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,