生成代码以使用JS为数字设置动画 [英] Generate code to animate numbers with JS

查看:70
本文介绍了生成代码以使用JS为数字设置动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hy


我正在网页上工作,使用C#语言,我打算做的是有生命的数字。



我最初的问题如下:

我有一个随机生成数字(6位)的方法。在我有这个号码之后,我想在javascript中调用一个方法来显示这个绘制的值,但是以生动的方式。我想知道如何将这个作为参数绘制的值传递给javascrip函数。

javascrip代码实际设计,但我想根据我的需要调整它。这是代码 http://jsfiddle.net/tkG2H/338/ [ ^ ],我唯一的问题是通过我的方法GenerateRandom()调用负责显示数字的函数在动画形式上。

上面这个例子,通过按钮点击调用该函数。但我的需要是通过单击按钮,调用我的函数GenerateRandom(),它将负责调用函数来显示数字,作为参数传递相同的值。



任何疑问,我可以把我的函数的所有代码GenerateRandom()。

等一个解决方案我感谢

hy
I am working on a web page , using the C # language and I intend to do is animate numbers.

My initial problem is the following :
I have a method that generates a number ( 6 digits ) randomly . after I have this number , I want to call a method in javascript that will display this value drawn , but in a lively manner . I want to know how to pass this value drawn as parameter to a javascrip function.
the javascrip code is practically designed , but I want to adapt it to my need . this is an example of the code http://jsfiddle.net/tkG2H/338/[^] , my only problem is through my method " GenerateRandom ( ) " call the function responsible for showing the number on animated form .
this example above , the function is called via the button click . But my need is through the click of the button , call my function " GenerateRandom ( ) " , and it will be responsible for calling the function to display the number , passing as parameter the same value drawn.

any doubts , I can put all the code of my function " GenerateRandom ( ) " .
wait one solution and I thank

推荐答案

这是你要找的吗?



Is this what you're looking for?

function Show(value)
{
    var


obj =


#foo);


这篇关于生成代码以使用JS为数字设置动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆