我有100多个图像的图像画廊,使其加载速度更快我想它分割成30组在页面上有一个导航“图库1 2 3 4 5“,当用户点击任何数字时,我想将链接的href加载到”#rCol“ - 但只有”#galleria“部分。我可以得到它加载的内容,但它)加载整个页面和B)“环球免税店”功能未启用。帮助加载“画廊”画廊与.load
是否可以创建一个包含所有图像的xml文件并创建一次跳过30的传呼机?
我想从链接的href做一个var,所以我不必为每个类添加一个类,并为每个类写一个函数。
$("ul#gallery li a").live('click',function(e) {
e.preventDefault();
var $parent = $(this).parent();
$parent.addClass("selected").siblings().removeClass("selected");
var href = $(this).attr('href');
$("#rCol").load(href, function() {
$("#galleria").galleria();
});
});
// Initialize Galleria
$("#galleria").galleria({
transition: 'fade',
width: 800,
height: 536,
extend: function(options) {
Galleria.log(this) // the gallery instance
Galleria.log(options) // the gallery options
// listen to when an image is shown
this.bind('image', function(e) {
Galleria.log(e) // the event object may contain custom objects, in this case the main image
Galleria.log(e.imageTarget) // the current image
// lets make galleria open a lightbox when clicking the main image:
$(e.imageTarget).click(this.proxy(function() {
this.openLightbox();
}));
});
}
});
有什么想法吗?
试图重新初始化“圆顶场所”功能here。各种各样的问题,没有更新缩略图然后点击专辑2,回到专辑1它加载整个页面的div。
$("ul#gallery li a").live('click',function(e) {
e.preventDefault();
var $parent = $(this).parent();
$parent.addClass("selected").siblings().removeClass("selected");
var href = $(this).attr('href');
$("#rCol").load(href, function() {
$("#galleria").galleria({
transition: 'fade',
width: 800,
height: 536,
extend: function(options) {
Galleria.log(this) // the gallery instance
Galleria.log(options) // the gallery options
// listen to when an image is shown
this.bind('image', function(e) {
Galleria.log(e) // the event object may contain custom objects, in this case the main image
Galleria.log(e.imageTarget) // the current image
// lets make galleria open a lightbox when clicking the main image:
$(e.imageTarget).click(this.proxy(function() {
this.openLightbox();
}));
});
}
});
});
});
“加载整个页面”,你的意思是包括''和'
'和''?这会让它变得有趣。你能发布一个链接到整个HTML响应吗?你可能只需要在JS中使用2个'response.split'。 (讨厌,但可能。) – Rudie 2011-05-02 20:25:12PS。 '.live'确实只适用于''点击事件,不适用于广告系列插件,但您可以重新初始化,没问题。 – Rudie 2011-05-02 20:26:39
@Rudie,请参阅上面编辑的评论,以便我重新启用画廊功能。 thx人。 – 2011-05-02 20:41:09