简体   繁体   English

Wordpress推荐滑块及其与页脚的链接

[英]Wordpress testimonial slider and it's link with footer

I am creating a Wordpress website for one client. 我正在为一个客户创建一个Wordpress网站

On the home page, I added testimonials, when testimonials slider works, footer below also re-sized (up and down). 在主页上,我添加了推荐书,当“推荐书”滑块起作用时,下方的页脚也会重新调整大小(上下)。 I want to know how can I fix this thing? 我想知道该如何解决? I don't want the footer to move when client slider moves. 当客户端滑块移动时,我不希望页脚移动。

I think you should calc the min-height dynamically via jQuery 我认为您应该通过jQuery动态计算最小高度

  jQuery(document).ready(function($) {

        $(window).resize(function () {

        var minHeight = -1;
        $('.home-testimonial .slides > li').each(function() {
          minHeight = minHeight > $(this).height() ? minHeight : $(this).height();
        });
        minHeight+=300;
        $('.home-testimonial').css('min-height', minHeight+'px');

        });
   }); 

this will see the longest testimonial you have and put the main height of the container based to it so it will work if you have very long testimonial or on mobile 这将看到您拥有的最长证词,并根据其放置容器的主要高度,因此,如果您有很长的证词或在移动设备上使用,它将可以正常工作

This is not really a WordPress question, is more of a CSS question. 这实际上不是WordPress问题,更多是CSS问题。

As the testimonials transition, the content below (in this case the footer) is following it up / down. 随着个人鉴定的过渡,下面的内容(在本例中为页脚)在上/下跟随。

In order to prevent this, you need to add some CSS that will add a min-height to the testimonial container. 为了防止这种情况,您需要添加一些CSS,这些CSS会将min-height添加到推荐容器中。

The following CSS will work with the length of testimonials you have now . 以下CSS将与您现在拥有的推荐长度一起使用 If your testimonials get longer, then the number will have to be increased: 如果您的推荐时间更长,则必须增加数量:

.home-testimonial {
    min-height: 625px;
}

You can add this to your theme's stylesheet, or any custom styles areas they allow you to set up. 您可以将其添加到主题的样式表,或它们允许您设置的任何自定义样式区域中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM