首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ajax调用后的slimbox,使用next/previous函数

ajax调用后的slimbox,使用next/previous函数
EN

Stack Overflow用户
提问于 2009-06-11 18:30:33
回答 1查看 1.1K关注 0票数 0

在使用AJAX调用动态加载内容后,我正在尝试使用SLIMBOX图库中的下一个/上一个按钮。

代码语言:javascript
复制
$(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的下一个/上一个函数。我希望这是足够的信息继续下去,我真的需要让它工作。谢谢。

EN

回答 1

Stack Overflow用户

发布于 2010-06-16 17:56:00

您可以在http://www.twozao.com/2010/06/previous-next-functionality-with-php.html中找到使用ajax的上一个/下一个函数的简单示例。我想这对你会有帮助的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/982828

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档