【问题标题】:Cufon Text Disappear in jcarouselCufon 文本在 jcarousel 中消失
【发布时间】:2011-04-30 14:52:04
【问题描述】:

我正在无限轮播上实现 cufon。问题是当 carousel 动态生成下一个循环时, cufon 不会在该循环中显示。有什么解决办法吗?有没有办法在动态生成的文本上实现 cufon?

这里是演示链接

http://hashmatabbas.zxq.net/demo/

点击右键,滚动两次后cufon消失

【问题讨论】:

    标签: jcarousel cufon


    【解决方案1】:

    尝试使用 Cufon.replace 代替 Cufon.refresh

    jQuery(".jcarousel-next, .jcarousel-prev").click(function() {
          Cufon.replace(".box_desc h3"); 
    })
    

    【讨论】:

    • 它在 Internet Explorer 8 中不起作用 - 我在常规字体下接收 cufon 文本 - floomby.ru/content/hzjMHkhkOH 就像在这个例子中一样。有人有同样的问题并找到决定吗?
    【解决方案2】:

    编辑 jquery.jcarousel.js 并添加

    Cufon.refresh(".your class here");
    

    在下一个和上一个函数中。

    例如,目前在 2011 年 6 月 28 日,我正在使用来自 http://sorgalla.com/jcarousel/ 的版本:0.2.8,您要修改的代码从第 455 行开始,请参见下面的示例:

    /**
    * Moves the carousel forwards.
    *
    * @method next
    * @return undefined
    */
    next: function() {
    if (this.tail !== null && !this.inTail) {
    this.scrollTail(false);
    } else {
    this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size !== null && this.last == this.options.size) ? 1 : this.first + this.options.scroll);
    Cufon.refresh(".your class here");
    }
    },
    
    /**
    * Moves the carousel backwards.
    *
    * @method prev
    * @return undefined
    */
    prev: function() {
    if (this.tail !== null && this.inTail) {
    this.scrollTail(true);
    } else {
    this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size !== null && this.first == 1) ? this.options.size : this.first - this.options.scroll);
    Cufon.refresh(".your class here");
    }
    },
    

    【讨论】:

      【解决方案3】:

      你需要像这样触发Cufon.refresh();

      jQuery(".jcarousel-next, .jcarousel-prev").click(function() {
            Cufon.refresh(".box_desc h3"); 
      })
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-08-25
        • 1970-01-01
        • 2011-03-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多