【问题标题】:Problems using jQuery quicksand with fancybox, revisited使用带有fancybox的jQuery流沙的问题,重新审视
【发布时间】:2012-03-20 03:33:18
【问题描述】:

我不知道我所做的是否正确,但如果不正确,请告诉我。我对上一篇文章有​​疑问:Problems using jQuery quicksand with fancybox

fancybox 运行良好,但我遇到了问题。当我使用脚本时:

$("a.grouped_elements").fancybox({
'titlePosition'     : 'inside',
'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
     return '<span id="fancybox-title-inside">Image ' + (currentIndex + 1) + ' / ' +
              currentArray.length + (title.length ? ' &nbsp; ' + title : '') + 
             '</span>';
}

它是沙盒插件,它克隆元素以便轻松排列它们,它克隆第一组 5 次,其余 3 次,所以我的第一个画廊有 7 个图像,5 个沙盒克隆 = 第二个画廊中有 35 个图像画廊有 4 x 3 的克隆 = 画廊中有 12 张图片,依此类推。

我该如何解决这个问题?

这是网站的链接:http://www.lslx-web.com/teste/index.html


再一次,像你们这样的人 arttronics 是非常好的人。它工作正常。

【问题讨论】:

  • 该标题完全没有描述性,请更正
  • 感谢您的满意回答,但请不要添加答案来表达这一点。它们将被删除(并损害您的帐户,因为您是新手)。您可以在 50 代表处评论其他答案,或者如果您拥有该问题或答案,则现在。另外,如果答案对您有用,请点赞并选择正确。

标签: jquery-plugins fancybox


【解决方案1】:

制作漂亮的 HTML5 作品集教程网站不会为您发布解决方案,但我认为这是一个很好的地方,因为其他人也有这个问题。

首先,您网页的 Head Section 应类似于 THIS 以纠正基本错误。

第二,你的Body Section有很多没有关闭的li标签。

第三,这里是在画廊模式下使用 Fancybox 和其他 jQuery 灯箱克隆脚本但不缓存链接的解决方案:

// This jQuery shown is part of your customized .js file for use with quicksand.js
$('#stage').quicksand(link.data('list').find('li'), function() {

   //
   //  Place your usual jQuery or Javascript GALLERY markup here with CLONING issue (not for cached gallery links).
   //

   // This next jQuery line should be placed prior to the closing of your function.
   // All hidden items Quicksand has set on the webpage will be removed which in turns removes the CLONED jQuery elements.
   // When the Quicksand Menu Filter Button is used again, your filtered items will remain correct in gallery length.
   $('section#container').find('ul.hidden').remove();

});

【讨论】:

    猜你喜欢
    • 2011-12-24
    • 1970-01-01
    • 2015-04-11
    • 1970-01-01
    • 1970-01-01
    • 2010-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多