且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

onclick进度栏javascript

更新时间:2023-01-13 08:40:28

如何在显示进度条的同时单击运行和停止进度条而无需创建开始和停止按钮
这没有多大意义.必须有两个事件,一个开始和一个停止才能显示,然后隐藏进度条.

可以说,按钮单击事件是开始事件,那时您与服务器端进行了一些交互.一旦返回响应,这就是您的停止事件-隐藏进度条时.

您需要做的就是使用style的display属性将页面上的进度条图像隐藏起来.一旦需要(单击按钮后)就显示它,将display属性的值更改为"block",并且一旦发生stop事件,则使用display value作为"none"再次隐藏它.

尝试!
how to run and stopped progress bar on the way onclick displaying a progress bar without having to make a start and stop buttons
This does not make much sense. There has to be two events, one start and one stop to show and then hide the progress bar.

Lets say, the button click event is the start event and at that time you do some interaction with server side. Once you get back response that is your stop event - when you hide the progress bar.

All you need to do is to keep a progress bar image on your page hidden, using display attribute of style. Once needed (just after button click) show it changing the value of display attribute to ''block'', and once the stop event occurs, hide it again using display value as ''none''.

Try!


支持@S Mewara的帖子:

您可以查看以下链接.


代码项目链接 [编码论坛链接 [ TUTSPLUS链接 [
In support to @S Mewara ''s post :

You can take a look at the following links.


Code Project Link[^]


Coding Forum Link[^]

If you are looking for a little more Hi-Fi looking Progress Bar that uses JS and jQuerry take a look at the below link.

TUTSPLUS link [^]

BR//
Harsha