在使用AJAX调用动态加载内容后,我正在尝试使用SLIMBOX图库中的下一个/上一个按钮。
$(document).ready(function() {
$('.content_box').hide();
$('.sf-menuUP a').click(function(){
$('.content_box').fadeIn('slow');
});
var hash = window.location.hash.substr(1);
var href = $('.sf-menuUP li a').each(function(){
var href = $(this).attr('href');
if(hash==href.substr(0,href.length-5)){
var toLoad = hash+'.html #content';
$('#content').load(toLoad)
}
});
$('.sf-menuUP li a').click(function(){
var toLoad = $(this).attr('href')+' #content';
$('#content').fadeOut('fast',loadContent);
$('#load').remove();
$('#wrapper').append('<span id="load">LOADING...</span>');
$('#load').fadeIn('normal');
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
function loadContent() {
$('#content').load(toLoad,'',showNewContent())
}
function showNewContent() {
$('#content').fadeIn('normal',hideLoader());
}
function hideLoader() {
$('#load').fadeOut('normal');
}
return false;
});
$("a[rel^='lightbox']").livequery(function(){
$(this).slimbox({/* Put custom options here */}, null, function(el) {
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
}), function() {
//remove slimbox? this is called when elements no longer match
}
});});
slimbox被livequery反弹了,我只是不知道如何重新绑定slimbox的下一个/上一个函数。我希望这是足够的信息继续下去,我真的需要让它工作。谢谢。
发布于 2010-06-16 17:56:00
您可以在http://www.twozao.com/2010/06/previous-next-functionality-with-php.html中找到使用ajax的上一个/下一个函数的简单示例。我想这对你会有帮助的。
https://stackoverflow.com/questions/982828
复制相似问题