Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.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 如何向“用户”提供反馈;“墙”;moo工具插件JSON数据?_Javascript_Html_Json_Mootools - Fatal编程技术网

Javascript 如何向“用户”提供反馈;“墙”;moo工具插件JSON数据?

Javascript 如何向“用户”提供反馈;“墙”;moo工具插件JSON数据?,javascript,html,json,mootools,Javascript,Html,Json,Mootools,我发现了这个伟大的插件名为,但遗憾的是,无论是文档还是演示如何向其提供JSON对象 假设我们有JSON数组,比如: [ { href : "/my/photo/image1.jpg", title : "Me and Sara" }, { href : "/my/photo/image2.jpg", title : "Me and Sara on a trip" }, { href : "/my/photo/image3.jpg", title :

我发现了这个伟大的插件名为,但遗憾的是,无论是文档还是演示如何向其提供JSON对象

假设我们有JSON数组,比如:

[
 {
   href : "/my/photo/image1.jpg",
   title : "Me and Sara"
 },
 {
   href : "/my/photo/image2.jpg",
   title : "Me and Sara on a trip"
 },
 {
   href : "/my/photo/image3.jpg",
   title : "Me and Sara on a vacation"
 }
]
(它可以而且应该更大)但我希望你明白这一点。如何让“墙”用这样的JSON创建图像墙?

类似于:

var images = [
{
  href : "/my/photo/image1.jpg",
  title : "Me and Sara"
},
{
  href : "/my/photo/image2.jpg",
  title : "Me and Sara on a trip"
},
{
  href : "/my/photo/image3.jpg",
  title : "Me and Sara on a vacation"
 }
];
var counterFluid = 1;
var maxLength = images.length;
var wallFluid = new Wall("wall", {
                                "draggable":true,
                                "inertia":true,
                                "width":150,
                                "height":150,
                                "rangex":[-100,100],
                                "rangey":[-100,100],
                                callOnUpdate: function(items){
                                    items.each(function(e, i){
                                        var a = new Element("img[src=" + images[(counterFluid -1)].href + "]");
                                            a.inject(e.node).fade("hide").fade("in");
                                        counterFluid++;
                                        // Reset counter
                                        if( counterFluid > maxLength ) counterFluid = 1;
                                    })
                                }
                            });
// Init Fluid Wall
wallFluid.initWall();

如果您能提供一个JSFIDLE示例,那就太棒了。谢谢看看资料来源,我是为我的老雇主做的,json提供了他们所有产品的真实数据和视频评论。