تصف هذه المقالة طريقة JS لتحقيق تأثير تضخيم النص. شاركه للرجوع إليه. طريقة التنفيذ المحددة هي كما يلي:
انسخ الرمز على النحو التالي: <! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title> يدرك JS تأثير تكبير النص </title>
<script type = "text/javaScript">
var n = 12 ؛
وظيفة chantxt ()
{
var obj = document.getElementById ("test") ؛
إذا (n <= 42)
{
obj.style.fontsize = n+"px" ؛
}
n ++ ؛
}
</script>
</head>
<body> يمر الماوس عبر الجزء البرتقالي
<div id = "test" onMouseover = "setInterval ('chantxt ()' ، 100)"> wulin.com </viv>
</body>
</html>
آمل أن تكون هذه المقالة مفيدة لبرمجة JavaScript للجميع.