This article describes the method of JS to achieve text amplification effect. Share it for your reference. The specific implementation method is as follows:
Copy the code as follows:<!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 realizes text enlargement effect</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>The mouse passes through the orange part
<div id="test" onmouseover="setInterval('chanTxt()',100)">Wulin.com</div>
</body>
</html>
I hope this article will be helpful to everyone's JavaScript programming.