分类分类
更新时间:2015-05-11 16:16作者: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程序设计有所帮助。
相关
纸片马里奥(Paperboat)角色扮演107.85 MBv1.0.32026-11-29
下载cyime输入法实用工具74.58 MBv1.15.1072026-11-29
下载武道仙宗官方版角色扮演456.19 Mv1.0.02026-11-29
下载mmrl模块app实用工具7.15 Mv342962026-11-29
下载零希沃特手机版角色扮演511.54 Mv1.4.22026-11-29
下载Bannerlator手游辅助574.84 MBv3.2.12026-11-29
下载巅峰激战(魔幻格斗游戏)动作射击797.1 MBv1.0.92026-11-29
下载我的火车防御策略游戏181.87 Mv1.1.52026-11-29
下载三国棋逢对手角色扮演1.7Gv1.2.5.0002.1125.11432026-11-29
下载图纸没问题手机版休闲益智78.41 Mv1.0.182026-11-29
下载蛊界永生角色扮演407.01 Mv0.4.162026-11-28
下载百炼仙途角色扮演528.9 Mv10002026-11-28
下载










