Artikel ini menjelaskan metode JS untuk mencapai efek amplifikasi teks. Bagikan untuk referensi Anda. Metode implementasi spesifik adalah sebagai berikut:
Salin kode sebagai berikut: <! Doctype html public "-// w3c // dtd xhtml 1.0 transisi // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title> JS mewujudkan efek pembesaran teks </iteme>
<type skrip = "Teks/JavaScript">
var n = 12;
fungsi chantxt ()
{
var obj = document.geteLementById ("test");
if (n <= 42)
{
obj.style.fontsize = n+"px";
}
n ++;
}
</script>
</head>
<body> Mouse melewati bagian oranye
<div id = "test" onmouseover = "setInterval ('chantxt ()', 100)"> wulin.com </div>
</body>
</html>
Saya harap artikel ini akan membantu pemrograman JavaScript semua orang.