JQTouchPhotoGallery ajax
我正在尝试在 $.ajax jquery 函数中加载 JQTouchPhotoGallery 动态图像。 但图库不显示图像,只显示加载微调器。结果中的图像数量也未正确显示在顶部栏(412 中的第 1 个)...
$(function(){
$(".folio").click(function(){
var portfolio_id = $(this).attr('id');
$.ajax({
async:false,
type: "GET",
url: "portfolio.php",
data: "portfolio_id="+portfolio_id+"",
success: function(data){
//alert( "Data Saved: " + data );
jQT.generateGallery("portfolio-slides-"+portfolio_id,data);
}
});
});
});
php 的结果是:
[
{src:"../img/upload/portfolio/portfolio-2_Hochhauser1.jpg"},
{src:"../img/upload/portfolio/portfolio-2_Hochhauser2.jpg"}
]
意味着,主画廊代码脚本应该如下所示:
jQT.generateGallery("portfolio-slides2",[
{src:"../img/upload/portfolio/portfolio-1_LOOSHAUS_1.jpg"},
{src:"../img/upload/portfolio/portfolio-1_LOOSHAUS_2.jpg"}
]);
我的 javascript 代码完全错误吗?如果我提醒数据,一切似乎都正常。或者是否有一些我没有考虑到的限制...
任何帮助将不胜感激,提前谢谢您!
问候,伯恩哈德
i'm trying to load the images for the JQTouchPhotoGallery dynamic in a $.ajax jquery function.
but the gallery doesn't show the images, only the loading spinner. also the number of images from the result are not displayed correctly at the top bar (1 of 412)...
$(function(){
$(".folio").click(function(){
var portfolio_id = $(this).attr('id');
$.ajax({
async:false,
type: "GET",
url: "portfolio.php",
data: "portfolio_id="+portfolio_id+"",
success: function(data){
//alert( "Data Saved: " + data );
jQT.generateGallery("portfolio-slides-"+portfolio_id,data);
}
});
});
});
the result from the php is:
[
{src:"../img/upload/portfolio/portfolio-2_Hochhauser1.jpg"},
{src:"../img/upload/portfolio/portfolio-2_Hochhauser2.jpg"}
]
means, the main gallery code script should look like this:
jQT.generateGallery("portfolio-slides2",[
{src:"../img/upload/portfolio/portfolio-1_LOOSHAUS_1.jpg"},
{src:"../img/upload/portfolio/portfolio-1_LOOSHAUS_2.jpg"}
]);
am i completely wrong with my javascript code?? if i alert the data, all seems to be working. or are there some restrictions which i didn't consider...
any help would be really appreciated, thank you in advance!
greetings, bernhard
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除了传递错误的数据之外,您的代码没有任何问题。我的意思是我实际上不明白为什么你要把赋值运算符放在字符串中!这就是为什么您的图像没有被显示的原因。只需按原样使用数据,看看它是否有效
There is no problem in your code except that you are passing wrong data. I mean I actually don't understand why are you putting assignment operator in a string! That is why your image are not being shown. Just use the data as it is and see if it works