重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

TypewriterSimulation的示例代码

这篇文章给大家分享的是有关Typewriter Simulation的示例代码的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

成都创新互联公司-专业网站定制、快速模板网站建设、高性价比安溪网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式安溪网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖安溪地区。费用合理售后完善,10多年实体公司更值得信赖。

Typewriter Simulation

下面的 HTML 文件中有一个 IE5 introduced DHTML behaviors. Behaviors are a way to add DHTML functionality to HTML elements with the ease of CSS.How do behaviors work? By using XML we can link behaviors to any element in a web page and manipulate that element.

上面是 XML 文档 "behave.htc":





var i,text1,text2,textLength,t;

function beginTyping()
{
i=0;
text1=element.innerText;
textLength=text1.length;
element.innerText="";
text2="";
t=window.setInterval(element.id+".type()",speed);
}

function type()
{
text2=text2+text1.substring(i,i+1);
element.innerText=text2;
i=i+1;
if (i==textLength)
  {
  clearInterval(t);
  }
}

感谢各位的阅读!关于“Typewriter Simulation的示例代码”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!


名称栏目:TypewriterSimulation的示例代码
文章出自:http://cqcxhl.com/article/ijphcg.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP