Cufon Text Disappear in jcarousel

核能气质少年 提交于 2019-12-11 23:29:24

问题


Iam implementing cufon on infinite carousel. The problem is that when carousel dynamically generates next loop cufon dont shows there in that loop. Is there any fix? and Is there any way to implement cufon on dynamically generated text?

Here is the Demo link

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

click on right button and after two scrolls the cufon disappears


回答1:


Try to use Cufon.replace instead Cufon.refresh

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



回答2:


Edit the jquery.jcarousel.js and add

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

within the next & previous functions.

So for example, currently on 06/28/11 I'm using Version: 0.2.8 from http://sorgalla.com/jcarousel/ the code you want to modify starts on line 455, see sample below:

/**
* 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:


You need to trigger Cufon.refresh(); like so:

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


来源:https://stackoverflow.com/questions/5842516/cufon-text-disappear-in-jcarousel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!