Open ghost opened 10 years ago
Try to set slideshow container height before running jcycle. slideshow container is hidden by default.
var slideshow = $('#slideshow');
slideshow
.css('height', '0px')
.show()
.stop()
.animate(
{ height : $(".slide:first", slideshow).height() +'px' },
1000,
'easeOutExpo',
function(){ slideshow.cycle( options ); }
);
Well, I am using declarative markup/auto initialization. I'll try to hook a function (that sets the height) inside one of the cycle initialization functions and unset the height afterwards.
I have the same problem. Wondering if someone solved it. I'm going to try what schwarzenneger recommended but seems like the code should be updated.
Cycle2 causes a flash of unstyled content for a very, very short time but it is noticeable. The slideshow seems to disappear (the content below it moves up accordingly) and reappear (the content below it moves back). This seems to happen during auto-height calculation. Here is the HTML markup:
CSS markup:
All images except the first one are set to
display: none
to prevent FOUC as suggested in documentation. All images are fluid width, auto height.z-index: 1
is set to prevent z-index issues with other widgets on the page.I think the reason is as follows:
position: absolute
; which makes the container 0px tall and the content below the slideshow moves upposition: relative
; the container is still 0px tallonResize
handler is called which in turn callsinitAutoHeight
which creates a position: static slide to set the container height. The FOUC seems to appears for those 30 milliseconds.