<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>部长演习jquery性能</title>
<script src="js/jquery-1.11.1.min.js"></script> <style>
.bor{border:10px solid yellow;}
.red{color:red;}
</style>
<script>
$(document).ready(function(e) { //添加属性居中
//$('div').attr('align','center'); //设定多个属性
$('div').attr({'align':'center','id':'myaa','title':'aaaaaaaaa'}); //$('div').css('text-align','right'); //读取align属性值。并提示框显示出来
//alert($('div').attr('align')); //鼠标经过更换图片
$('img:first').hover(function(){
$(this).attr('src','b.jpg'); //鼠标经过添加样式
$(this).addClass('bor'); //鼠标离开还换为原来的图片
},function(){
$(this).attr('src','33.jpg'); //鼠标离开减去样式
$(this).removeClass('bor');
}); //鼠标经过字体变颜色
$('h1:first').hover(function(){
$('h1:first').toggleClass('red');
},function(){
$('h1:first').toggleClass('red');
}); });
</script>
</head> <body>
<h1>鼠标经过换图片</h1>
<div>ok</div>
<img src='33.jpg' width="300" height="200">
<hr>
<img src='33.jpg' width="300">
<img src='b.jpg' width="300" height="200"> </body>
</html>

版权声明:本文博主原创文章,博客,未经同意不得转载。

最新文章

  1. mysql 中基础英语单词 (一)关于数据库创建与查找 (包括简写单词)
  2. angularjs 表单验证(不完整版)
  3. linux常识以及常用命令和参数
  4. oracle日期函数2!
  5. xss攻击和sq注入
  6. database first表更新一个表会更新所有的model,包括添加验证代码,解决办法
  7. 关于c#生成word。
  8. new Option及用法
  9. ZJOI2017 Day3 滚粗记
  10. BZOJ 1770: [Usaco2009 Nov]lights 燈 [高斯消元XOR 搜索]
  11. mysql常用基础操作语法(十一)~~字符串函数【命令行模式】
  12. Hibernate Annotation _List/Map
  13. maven 禁止连接外网仓库
  14. 电子医疗设备创新研发应该用i.MX6Q开发板吗?为医疗设备提供解决方案
  15. CentOS5.5 - lnmp环境安装与使用
  16. Socket编程(网络编程)
  17. Java第三阶段学习(七、线程池、多线程)
  18. C#时间格式化显示AM/PM
  19. docker centos 老是退出
  20. 自学Python1.3-centos内python3并与python2共存

热门文章

  1. 【oracle案件】ORA-19502,ORA-27072
  2. Win32 Windows规划 三
  3. [MSSQL]最小公约数
  4. 怎样设制 select 不可编辑 仅仅读
  5. 玩转Web之easyui(一)-----easy ui datagird 分页
  6. Ext,保存输入记录,并会提示输入
  7. Android技术——切换视图(两)随着ViewPage达到Tab幻灯片浏览
  8. Redis数据结构
  9. Java彻底 - WEB容器的侦听具体解释 ServletContextListener
  10. java得到clientIP地址和MAC住址