码迷,mamicode.com
首页 > 其他好文 > 详细

知乎首页延时交互的小思路

时间:2014-07-23 12:07:46      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   java   color   width   

bubuko.com,布布扣

感觉这种交互,比把鼠标放到头像上右侧内容马上就改变要好。

<!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" />
<script src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
<style type="text/css">
body{
    margin:50px;
    }
.touxiang{
    border:1px solid #E5D1A1; text-align:center; width:150px; height:150px; background:#FFFDD2; float:left;
    }
.neirong{
    width:300px;height:500px; margin-left:30px;border:1px solid #E5D1A1;background:#fff;float:left;
    }
</style>
</head>
  <body>
    <div class="touxiang">这里是头像</div>
  <div class="neirong">这里是内容区域</div>
  </body>
<script type="text/javascript">
function changetext(){
    $(".neirong").text(hahaha);
}

$(function(){
$(".touxiang").hover(function(){
 timeout_name = setTimeout("changetext()",1500);
      },function(){
      clearTimeout(timeout_name) ;
      })
  })
</script>

</html>

知乎首页延时交互的小思路,布布扣,bubuko.com

知乎首页延时交互的小思路

标签:style   blog   http   java   color   width   

原文地址:http://www.cnblogs.com/kgdxpr/p/3862174.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!