本文介绍了FlexSlider 2在窗口调整大小调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个响应的主题为WordPress建立在Twitter Bootstrap。我在首页上使用幻灯片jQuery插件。

I'm making a responsive theme for WordPress built on Twitter Bootstrap. I'm using the FlexSlider slideshow jquery plugin on the homepage.

不幸的是,当我调整浏览器的大小时,FlexSlider不会优雅地调整大小。当我走得更窄,图像很可能被裁剪。如果我更宽,下一个图像的一部分可以出现在一边。即使我使用FlexSlider网站的演示代码也会发生这种情况。它甚至发生在FlexSlider演示。但是Dany Duchaine的[Energized主题] [3]设法随着视口的改变而改变FlexSlider的大小。谁能解释他是怎么做的,或者建议任何方式,我可以改善我的版本的行为?

Unfortunately, when I resize my browser, FlexSlider doesn't resize gracefully. When I go narrower, the image is liable to get cropped off.. if I go wider, part of the next image can appear to the side. This happens even when I use the demo code from the FlexSlider website. It even happens on the FlexSlider demo. But Dany Duchaine's [Energized theme][3] manages to resize FlexSlider nicely as the viewport changes. Can anyone explain how he's doing it, or suggest any way I can improve the behaviour of my version?

谢谢!

推荐答案

你可能有一个解决方案或已经在这个阶段,但我想我会指出这个问题在github上的访问者:(注意patbouche的回答)。这个解决方案为我工作。我把它放在之后:回调。

You probably have a solution or have moved on at this stage but I thought I'd point out this issue on github for visitors: https://github.com/woothemes/FlexSlider/issues/391 (note patbouche's answer). This solution worked for me. I put it in the after: callback.

var slider1 = $('#slider1').data('flexslider');
slider1.resize();

这篇关于FlexSlider 2在窗口调整大小调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 07:39