我怎样才能提供X次拖放? [英] how can I provide drag and drop X times?

查看:74
本文介绍了我怎样才能提供X次拖放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用拖放javascript函数但是想在这个javascript中放置条件。



我将从mysql数据库中计算一个区域或列。

和javascipt拖放功能将运行此计数次数



for ex:from database count = 3 javascript拖放运行3次不运行大于3.不丢弃或不拖动



我该怎么办?

有没有javascript代码?(条件拖放)



非常感谢。

I want to use drag and drop javascript function but want to put condition in this javascript.

I will count a area or column from mysql database.
And javascipt drag and drop function will run this count times

for ex: from database count=3 javascript drag and drop run 3 times not run greater than 3.not dropped or not draggin

how can I do?
İs there any javascript code?(conditional drag and drop)

thanks a lot.

推荐答案

逻辑将如下



1.将从mysql中获取的迭代次数存储在javascript变量中。

2.声明一个javascript计数器,该计数器将针对每组拖放进行递增。

3.在每次放置事件完成后,将mysql的交互次数与拖放计数器变量进行比较,如果两个值匹配,则取消绑定pa来自控件的特定拖放事件。像这样的东西



if(iteration_variable == counter_variable){

// ...解除拖放事件的代码

}



我希望这可行。如果您可以发布部分javascript函数的代码片段,那么我可以帮助您在代码中应用相同的逻辑。



如果上述逻辑是,请告诉我对你有用。



快乐编程。

:)
The Logic is will be as follows

1. Store the number of iteration fetched from mysql in a javascript variable.
2. Declare a javascript counter which will be incremented for each set of drag and drop.
3. Compare the number of interation from mysql with the drag and drop counter variable after the completion of each drop event and if both values got matched then unbind the particular drag and drop event from the control. Something like this

if(iteration_variable == counter_variable){
//... Code to unbind the drag-drop event
}

I hope this might work. If you can post the code snippets of the partcular javascript function then I can help you apply the same logic in your code.

Please let me know if the above logic is useful for you.

Happy Programming.
:)


这篇关于我怎样才能提供X次拖放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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