jquery字体更改后的鼠标-影像学改变//凝视内容
2024-08-22 02:04:45
<!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>
版权声明:本文博主原创文章,博客,未经同意不得转载。
最新文章
- mysql 中基础英语单词 (一)关于数据库创建与查找 (包括简写单词)
- angularjs 表单验证(不完整版)
- linux常识以及常用命令和参数
- oracle日期函数2!
- xss攻击和sq注入
- database first表更新一个表会更新所有的model,包括添加验证代码,解决办法
- 关于c#生成word。
- new Option及用法
- ZJOI2017 Day3 滚粗记
- BZOJ 1770: [Usaco2009 Nov]lights 燈 [高斯消元XOR 搜索]
- mysql常用基础操作语法(十一)~~字符串函数【命令行模式】
- Hibernate Annotation _List/Map
- maven 禁止连接外网仓库
- 电子医疗设备创新研发应该用i.MX6Q开发板吗?为医疗设备提供解决方案
- CentOS5.5 - lnmp环境安装与使用
- Socket编程(网络编程)
- Java第三阶段学习(七、线程池、多线程)
- C#时间格式化显示AM/PM
- docker centos 老是退出
- 自学Python1.3-centos内python3并与python2共存