[英]How Can I pass an array or add a loop in jQuery function
Here is the function - 这是功能 -
$.swipebox( [
{ href:'big/image1.jpg', title:'My Caption' },
{ href:'big/image2.jpg', title:'My Second Caption' }
] );
Instead of this I would like add a loop here or if not possible then pass an array. 而不是这个我想在这里添加一个循环或如果不可能然后传递一个数组。
Something like - 就像是 -
$.swipebox( [
$.each( data, function(index, val){
{ href:data[index].image_link, title:data[index].image_title }
} )
] );
or something similar to this. 或类似的东西。 I will be really glad if anyone could help me with that. 如果有人能帮助我,我会很高兴的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.