jsor / jcarousel

Riding carousels with jQuery.
https://sorgalla.com/jcarousel/
MIT License
1.99k stars 736 forks source link

Problem whit pagination itens #641

Closed ghost closed 10 years ago

ghost commented 10 years ago

every time that i access the page the itens nunbers are wrong and i need to reload the page to fix it, every time that i reload using control + f5 the problem appears agaim

jsor commented 10 years ago

Could you setup a jsfiddle where i can see your setup?

tanasebutcaru commented 10 years ago

I can confirm this issue. It happens to me too, but only with webkit browsers (Chrome & Opera). With Firefox / IE11 everything works fine.

update

Here's my configuration: http://jsfiddle.net/uzzuw/ It seems that on jsfiddle everything works just fine with all browsers, but on local (with same configuration) it simply doesn't. Where's the problem?

update2

After control+f5, as @jasaroc said, everything comes back to normal, but on page refresh the issue is back. When this happens, I noticed that Opera browser's console outputs this specific error:

Uncaught TypeError: Cannot call method 'index' of null jquery.jcarousel.min.js:847
$.jCarousel.plugin._prepare jquery.jcarousel.js:847
$.jCarousel.plugin._reload jquery.jcarousel.js:344
$.jCarousel.plugin._create jquery.jcarousel.js:289
create jquery.jcarousel.js:79
$.(anonymous function) jquery.jcarousel.js:175
(anonymous function) jquery.jcarousel.js:219
b.extend.each jquery.js:3
b.fn.b.each jquery.js:3
$.fn.(anonymous function) jquery.jcarousel.js:213
(anonymous function) common.js:39
c jquery.js:3
p.fireWith jquery.js:3
b.extend.ready jquery.js:3
H

\ Probably on jsfiddle works fine because everytime you run the code it's something like ctrl+f5.

update3

When I link the script to @jsor website (http://sorgalla.com/jcarousel/dist/jquery.jcarousel.min.js) the issue is fixed, but when I switch back to local file it happens again. Even if I set my script src to absolute path nothing changes..

\ That's why the jsfiddle eg works!

tanasebutcaru commented 10 years ago

FIX

After inspecting jsfiddle page & my own, I noticed something was missing in my script. So when you begin writing the script configuration, MAKE SURE you wrap it inside the following:

$(window).load(function(){
    $(document).ready(function(){
           //your jCarousel configuration
    });
});

What I was missing was the (window).load function.

ghost commented 10 years ago

hum i not noticed that i will fix and try tankyou very mutch

2014-03-07 6:26 GMT-03:00 Jan Sorgalla notifications@github.com:

Closed #641 https://github.com/jsor/jcarousel/issues/641.

Reply to this email directly or view it on GitHubhttps://github.com/jsor/jcarousel/issues/641 .

Jasar orion Cirelli

http://www.avalanchecriattiva.com.br

Soluções inteligentes para propaganda e marketing.

Contato: email: jasaroc@gmail.com msn: suporte@targetzdigital.com Cel: (11) 986435771 ( TIM )