分类分类
更新时间:2026-02-18 19:44:18作者:zhao
本文实例讲述了jQuery实现仿腾讯微博滑出效果报告每日天气的方法。分享给大家供大家参考。具体分析如下:
这是仿腾讯微博滑出效果的每日天气代码,鼠标放上去,天气内容将从左向右滑出来,像开抽屉一样,本动画效果流畅,当然少不了jQuery的功劳,本代码使用了1.6.2版本的jQuery插件来实现这一功能。
<!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>仿腾讯微博的每日天气效果</title>
<style type="text/css">
.weather{
width:500px;height:100px;margin:0 auto;
position:relative;color:#fff;text-align:center;
overflow:hidden;
}
.weather_main{
width:99px;border-right:solid 1px #fff;
float:left;background:#F03;text-align:center;
position:relative;z-index:2;
}
.weather_main strong{
line-height:100px;
}
.weather_main strong a{
border-bottom:solid 2px #fff;cursor:pointer;
}
.alert{
width:400px;height:100px;position:absolute;
left:-400px;top:0;background:#F03;
}
</style>
<script src="jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".weather_main").hover(function(){
$(".alert").animate({left:"100px"},1000);
return false;
},function(){
$(".alert").animate({left:"-400px"},1000);
return false;
})
})
</script>
</head>
<body>
<div class="weather">
<div class="weather_main">
<strong><a>深圳</a></strong>
</div><!--weather_main-->
<div class="alert">
<p>如果云知道,多想凉风来做伴~</p>
<p><a>提醒好友</a></p>
</div>
</div><!--weather box-->
</body>
</html>
希望本文所述对大家的jQuery程序设计有所帮助。
相关
归墟战纪策略游戏262.92 MBv3.95802026-02-14
下载爆裂老奶策略游戏209.43 MBv1.0.112026-02-14
下载超能下蛋鸭策略游戏395.4 MBv1.2.82026-02-14
下载你好盒子实用工具12.1 MBv2.2.852026-02-14
下载我在峡谷当牛马休闲益智87.95 MBv0.7.12026-02-14
下载抽卡监狱2策略游戏190.75 MBv1.4.92026-02-14
下载Campus社交通讯94.36 MBv1.19.02026-02-14
下载冒险传奇角色扮演141.73 Mv9991.12026-02-14
下载心动次元app社交通讯43.96 Mv1.0.1.32026-02-14
下载致亲爱的我角色扮演1.63Gv1.02026-02-14
下载狼伴侣游戏手机版冒险游戏155.6 Mv1.02026-02-14
下载Loclike社交通讯169.08 Mv2.2.112026-02-14
下载










