Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of JS to achieve pop-up prompt effect after imitating Zhongguancun Forum score?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

JS to achieve imitation Zhongguancun Forum score after the pop-up prompt effect is what, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

Here is an example of how JS realizes the pop-up prompt effect after imitating the score of Zhongguancun Forum. Share it with you for your reference. The specific implementation methods are as follows:

JS imitates the effect of pop-up prompts after the Zhongguancun Forum score var x=window.x | {}; x.creat=function (trech breco c Magi d) {this.t=t; this.b=b; this.c=c; this.d=d; this.op=1; this.div=document.createElement ("div"); this.div.style.height= "40px"; this.div.style.width= "100px"; this.div.style.background= "red"; this.div.style.position= "absolute" This.div.style.left= 50%; this.div.style.marginLeft= "- 50px" this.div.style.marginTop= "- 20px" this.div.innerText= "Thank you for joining us! Experience + 5 "this.div.style.fontSize=" 12 "this.div.style.lineHeight=this.div.style.height this.div.style.textAlign=" center "; this.div.style.fontWeight=" bold "; / / this.div.style.border=" solid red 1px "; this.div.style.color=" # fff "this.div.style.top= (this.b+"% "); document.body.appendChild (this.div); this.run () } x.creat.prototype = {run:function () {var me=this; this.div.style.top=-this.c* (this.t/this.d) * (this.t/this.d) + this.b+ "%"; this.t++; this.q=setTimeout (function () {me.run ()}, 25) if (this.t==this.d) {clearTimeout (me.q); setTimeout (function () {me.alpha ();}, 1000) }, alpha:function () {var me=this; if ("\ v" = = "v") {this.div.style.filter= "progid:DXImageTransform.Microsoft.Alpha (opacity=" + this.op*100+ ")"; this.div.style.filter= "alpha (opacity=" + this.op*100+ ")";;} else {this.div.style.opacity=this.op} this.op-=0.02; this.w=setTimeout (function () {me.alpha ()}, 25) if (this.op)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report