malsup / cycle2

2nd gen cycling
899 stars 237 forks source link

Please help center working poorly and i have to launch site example: http://sizara.co.il/ #236

Open mikila85 opened 11 years ago

mikila85 commented 11 years ago

http://sizara.co.il/

i have to launch my main site with the cycle2 but i cant because the center plugin is buggy and the fix for it also does wierd centering bugs, i made an example site. and you can see sometimes it is all good and if you refresh some slides are not centered right.

i use the center plugin fix which is given here: https://github.com/malsup/cycle2/issues/211

http://sizara.co.il/

mikila85 commented 11 years ago

if you dont see the problem try refreshing, or if you see the problem you can refresh and see it move to diffrent pictures :( it is unstable.. please help sort it out.

malsup commented 11 years ago

Have you tried adding width/height attributes to your images? Or temporarily disabling bootstrap?

mikila85 commented 11 years ago

disabling bootstrap only make the image longer than it should but still does not fix the centering bug, and setting the attributes to the images is kind of missing the point of the "scaleToFit" & "centerInContainer", the sliders are resizable with jquery UI and setting all the images height & width on resize would be a big and slow problem with a big photos album. Please any more ideas? i'de be happy to try but i went through all the center code and tried changing anything i see there that might help even the timout there its not because of it i set it to 5000 and still didnt fix.

mikila85 commented 11 years ago

i dont get it, i made an isolation copy and here it seems to be working fine: http://jsfiddle.net/9eSvb/2/

and it is a copy paste with all the css and attributes... i cant find where the problem is originating from, and why different images every time and sometimes happens and sometimes all perfectly working :\

malsup commented 11 years ago

Another thing to try is: data-cycle-loader="wait"

mikila85 commented 11 years ago

Mike, well what do you know..data-cycle-loader="wait" solved it and i think its working :) i'll try it for another few days but it seems very stable now, you'r work is amazing as allways!! Thank you.

mikila85 commented 11 years ago

is there a way to trigger the center when the image's turn to show up or when it has loaded so it wont hold up the initialization?

sebheg commented 11 years ago

Magic data-cycle-loader="wait" :-)

mikila85 commented 11 years ago

but it just display:none; untill every single image finishes loading. wish could fix the center plugin so after finished loading center the images or when image needs to show up center it right before. or at least an animated loading image or anything to show there spose to be a slider there so wait for it to load.

malsup commented 11 years ago

I'll look into making it more robust when I get a chance.

mikila85 commented 11 years ago

looking forward to it ;)

mikila85 commented 11 years ago

need to remember that the first image detarmines the slider's width and height so need to load the first one atleast to get the sizes before you show a bordered frame with "loading.." in it. but it can be avoided if only the center plugin would be triggered after an image is loaded and then theres no need for all of this.

*from checks i did the center plugin "tries" to center on every resize but it does that with the same sizes it checked on the first time (wrong one because didnt load yet) and just calculate it on the new parent height and width, so the ratio of the mistake is maintained but the error isnt beign fixed. if i could only add on the center plugin to recheck the size of the image after it has been loaded the whole thing would be solved. and no need for the slowing data-cycle-loader="wait".