点击切换帐号登陆
帐号密码登陆

jQuery显示\隐藏

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>jquery动画效果</title>
	<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
  <script type="text/javascript">
   $(function(){
    // hide(speed,callback)隐藏;
     // $('.btu').click(function(){
     //  $('.one').hide(500, function(){
     //    $('body').css('background','red')
     //  })
     // })
    // show(speed,callback)显示;
    // $('.one').hide()
    // $('.btu').click(function(){
    //   $('.one').show()
      
    //   })
    //toggle(speed,callback)事件切换 显示被隐藏的元素,并隐藏已显示的元素;
    // $('.one').hide()
    // $('.btu').click(function(){
    //  $('.one').toggle()      
    //  })
    // hover() 方法规定当鼠标指针悬停在被选元素上时要运行的两个函数
    // 语法:
    // $(selector).hover(inFunction(){},outFunction(){}) 
    $('p').hover(
      function(){
        $(this).css('background','pink')
      },
      function(){
        $(this).css('background','#9EEA6A') 
      }
      )
   })

  </script>
  <style type="text/css">
  *{margin:0;padding:0;}
  .box{margin:20px auto;font-size:20px;color: #fff;width: 300px;}
  .box p{height: 160px;width: 300px;background: #9EEA6A;text-align: center;line-height: 160px;position: relative;}
  .box button{height: 40px;width: 300px;border:none;color: #fff;background: #437421;}
  </style>
</head>
<body>
  <div class="box">
     <button class="btu">点击</button>
     <p class="one">~ 我是p标签 ~</p>
  </div>  
</body>
</html>


任务

?不会了怎么办
无数据提示暂无评论哟...我要评论
网站导航
标签地图
学习路径
视频教程
开发软件
旗下子站
php中文网
phpstudy
技术文章
文档工具
关于我们
企业合作
人才招聘
联系我们
讲师招募
QQ交流群
QQ官方交流群
微信公众号
微信公众号