บทความนี้อธิบายวิธีการของ 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;
ฟังก์ชั่น chantxt ()
-
var obj = document.getElementById ("ทดสอบ");
ถ้า (n <= 42)
-
obj.style.fontsize = n+"px";
-
n ++;
-
</script>
</head>
<body> เมาส์ผ่านส่วนสีส้ม
<div id = "test" onMouseOver = "setInterval ('chantxt ()', 100)"> wulin.com </div>
</body>
</html>
ฉันหวังว่าบทความนี้จะเป็นประโยชน์กับการเขียนโปรแกรม JavaScript ของทุกคน