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 are the functions written with js

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly shows you "what are the functions written in js", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "what are the functions written in js" this article.

/ *

Library of my js

, /

/ / randomly generate n integers that are not repeated from xmury

Function check (nMagnex Magi y) {

Var num= []

For (var item0transferi57 | | text.charCodeAt (I) is simple and straightforward

/ / return judge==false? False: true

Return true

}

/ / transparent function, object, speed, target point, change frequency, callback function

Function diaphaneity (obj,speed,target,rate,enfn) {

Var setTime = null

Var target=target

Speed = parseFloat (getStyle (obj,'opacity')) * 1000bot iMurray frame) {

Arr.push (iMagneWhi)

}

Arr.push (0)

Var index=0

Var setdu=parseInt (size); / / if there is a problem, it needs to be solved.

Console.log (setdu)

SetTime=setInterval (function () {

If (index > = arr.length) {

Index=0

ClearInterval (setTime)

SetTime=null

} else {

Setdu=setdu+arr [index]

Obj.style [att] = setdu+ "px"

Index++

}

}, 50)

}

/ / move the layer up and down, left and right, parameter label object, up / down / left / right, end distance, callback function

Function doMove (obj, attr, dir, target, endFn) {

Var target=target

Dir = parseInt (getStyle (obj, attr))

< target ? dir : -dir; clearInterval( obj.timer ); obj.timer = setInterval(function () { var speed = parseInt(getStyle( obj, attr )) + dir;// 步长 if ( speed >

Target & & dir > 0 | | speed < target & & dir < 0) {

Speed = target

}

Obj.style [attr] = speed + 'px'

If (speed = = target) {

ClearInterval (obj.timer)

/ *

If (endFn) {

EndFn ()

}

, /

EndFn & & endFn ()

}

}, 30)

}

/ / get the value of the style

Function getStyle (obj, attr) {return obj.currentStyle?obj.currentStyle [attr]: getComputedStyle (obj) [attr];}

The above is all the contents of the article "what are the functions written in js?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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