开发者

Cufon Text Disappear in jcarousel

开发者 https://www.devze.com 2023-03-01 13:59 出处:网络
Iam implementing cufon on infinite carousel. The problem is that when carouseldynamically generates next loop cufon d开发者_开发问答ont shows there in that loop. Is there any fix? and Is there any way

Iam implementing cufon on infinite carousel. The problem is that when carousel dynamically generates next loop cufon d开发者_开发问答ont 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


Try to use Cufon.replace instead Cufon.refresh

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


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");
}
},


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

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

精彩评论

暂无评论...
验证码 换一张
取 消