Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/438.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jqueryui:如何在drop事件中从数组中获取数据_Javascript_Jquery_Arrays - Fatal编程技术网

Javascript jqueryui:如何在drop事件中从数组中获取数据

Javascript jqueryui:如何在drop事件中从数组中获取数据,javascript,jquery,arrays,Javascript,Jquery,Arrays,假设我有一个数组 <script> sectionsP = { "test": { "sections": { "1": { "name": "test1", "html": "<div id='test1-id'>Test 1 Hello</div>" }

假设我有一个数组

<script>

    sectionsP = {
        "test": {
            "sections": {
                "1": {
                    "name": "test1",
                    "html": "<div id='test1-id'>Test 1 Hello</div>"
                }
                "2": {
                    "name": "test2",
                    "html": "<div id='test2-id'>Test 2 Hello</div>"
                }
            }
        }

        "dummy": {
            "sections": {
                "1": {
                    "name": "dummy1"
                    "html": "<div id='dummy1-id'>Dummy 1 Hello</div>" 
                }
                "2": {
                    "name": "dummy2"
                    "html": "<div id='dummy2-id'>Dummy 2 Hello</div>" 
                }
            }
        }
    }

</script>

第SP节={
“测试”:{
“章节”:{
"1": {
“名称”:“test1”,
“html”:“测试1你好”
}
"2": {
“名称”:“test2”,
“html”:“测试2你好”
}
}
}
“虚拟”:{
“章节”:{
"1": {
“名称”:“dummy1”
“html”:“Dummy 1 Hello”
}
"2": {
“名称”:“dummy2”
“html”:“Dummy 2 Hello”
}
}
}
}
我想知道我怎样才能在drop事件中记录数据。例如,如果我有drag n drop test 2,那么我希望将test->sections->2中的数组值以html格式拖放


更新了

到目前为止您一直在尝试什么?在你的小提琴里没有JSON,拖拽也不起作用…@Cossintan我只是在为自己的练习做东西我是js新手,不是很新,但已经7个多月了,很抱歉JSON输入错误,我建议使用CSS3动画,而不是
.slideDown()因为CSS3动画是硬件加速的:)@Cossintan如果你知道我该怎么做,请帮忙。@XanderLuciano谢谢你的建议。