返回jQuery的......登陆

jQuery的DOM操作

Free flight2019-04-13 15:35:28222

jQuery获取/改变CSS

jQuery操作属性的方法

jQuery事件方法

jQuery事件切换:hover(over,out)鼠标移上效果和鼠标移出效果。

<!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>
</head>
<script type="text/javascript" src="jquery-3.4.0.min.js"> </script>
<style type="text/css">
div{width:200px;height:200px;border:1px solid #0F0}
</style>
<body>
<script type="text/javascript">
$(document).ready(function(){
  $('div').hover(
  function(){
  $(this).css('background','red')
  },
   function(){
  $(this).css('background','blue')
  }
  
  )
})

</script>
<div>我是内容</div>
</body>
</html>



最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送