この記事では、テキスト増幅効果を実現するJSの方法について説明します。参照のためにそれを共有してください。特定の実装方法は次のとおりです。
次のようにコードをコピーします。<
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title> jsはテキスト拡大効果を実現します</title>
<script type = "text/javascript">
var n = 12;
functionChantxt()
{
var obj = document.getElementById( "test");
if(n <= 42)
{
obj.style.fontsize = n+"px";
}
n ++;
}
</script>
</head>
<body>マウスはオレンジ色の部分を通過します
<div id = "test" onmouseover = "setinterval( 'chantxt()'、100)"> wulin.com </div>
</body>
</html>
この記事がみんなのJavaScriptプログラミングに役立つことを願っています。