JS实现文字放大效果的方法
作者:代码家园 时间:2024-04-25 13:09:52
本文实例讲述了JS实现文字放大效果的方法。分享给大家供大家参考。具体实现方法如下:
<!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>
<title>JS实现文字放大效果</title>
<script type="text/javascript">
var n = 12;
function chanTxt()
{
var obj = document.getElementById("test");
if(n <= 42)
{
obj.style.fontSize = n+"px";
}
n++;
}
</script>
</head>
<body>鼠标经过橙色部分
<div id="test" onmouseover="setInterval('chanTxt()',100)" style="width:300px; height:50px; font-size:12px; line-height:50px; background:#f90;">脚本之家</div>
</body>
</html>
希望本文所述对大家的javascript程序设计有所帮助。
标签:JS,文字,放大
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python 实现ping测试延迟的两种方法
2022-03-05 06:35:17
Java实现数据库连接的最详细教程分享
2024-01-28 01:34:15
![](https://img.aspxhome.com/file/2023/7/69347_0s.webp)
keras.layers.Conv2D()函数参数用法及说明
2022-02-25 01:15:05
python中异常捕获方法详解
2021-10-30 10:06:09
加固SQL参数与存储过程
2012-03-12 19:44:08
python实现发送QQ邮件(可加附件)
2023-01-21 18:37:00
![](https://img.aspxhome.com/file/2023/8/93778_0s.png)
MySQL定时任务不能正常执行的原因分析及解决方法
2024-01-23 16:28:24
![](https://img.aspxhome.com/file/2023/3/126293_0s.png)
Python+OpenCV实战之利用 K-Means 聚类进行色彩量化
2021-01-02 09:20:27
![](https://img.aspxhome.com/file/2023/9/101579_0s.jpg)
javascript+css实现俄罗斯方块小游戏
2024-04-23 09:28:06
![](https://img.aspxhome.com/file/2023/9/135519_0s.jpg)
python实现去除下载电影和电视剧文件名中的多余字符的方法
2022-08-17 16:17:59
![](https://img.aspxhome.com/file/2023/3/81683_0s.jpg)
加快Vue项目的开发速度的方法
2024-04-28 10:50:20
![](https://img.aspxhome.com/file/2023/0/133100_0s.png)
鼠标经过超链时的提示图层源码
2010-03-17 20:51:00
django文档学习之applications使用详解
2021-09-11 11:15:12
![](https://img.aspxhome.com/file/2023/2/107112_0s.png)
Python Django 简单分页的实现代码解析
2021-11-05 13:27:38
![](https://img.aspxhome.com/file/2023/8/85268_0s.png)
MySQL基本操作语句小结
2024-01-19 16:02:30
python开发实时可视化仪表盘的示例
2022-04-23 15:33:44
![](https://img.aspxhome.com/file/2023/0/112370_0s.gif)
python被修饰的函数消失问题解决(基于wraps函数)
2021-07-22 17:32:34
mysql 队列 实现并发读
2024-01-14 21:16:26
sql server常用命令行操作(启动、停止、暂停)
2012-01-05 19:02:48
Python中的进程操作模块(multiprocess.process)
2022-09-17 23:10:32