3

当我尝试在 Visual Composer 的行设置中拉伸行时,行会拉伸,但行的位置都是错误的。仅当身体方向具有direction:rtlcss 设置时才会发生。

网站上线:http ://ono.devurl.net/?page_id=871

有什么办法解决吗?

尤瓦尔。在此处输入图像描述

4

4 回答 4

12

尤瓦尔嘿!

试试这个脚本来解决你的问题。

    if( jQuery('html').attr('dir') == 'rtl' ){
        jQuery('[data-vc-full-width="true"]').each( function(i,v){
            jQuery(this).css('right' , jQuery(this).css('left') ).css( 'left' , 'auto');
        });
    }

将此脚本代码放在 jQuery(window).load 中。

希望这会帮助你:)

于 2016-09-15T08:32:33.817 回答
4

使用css可能更容易解决它,并且在调整页面大小时它也可以工作。在 [data-vc-full-width="true"] 之前为行找到一个类并将此类 css 添加到您的 rtl.css

.before-fullwidth-row {
    direction: ltr;
}
.before-fullwidth-row > div {
    direction: rtl;
}

似乎工作...

于 2016-11-26T20:21:15.263 回答
0

如果您还想修复 VC Row,请window resize使用此解决方案:

    $(window).on( 'resize', function() {
        $( '.rtl [data-vc-full-width="true"]' ).each( function(){
            $( this ).css( 'right' , $( this ).css( 'left' ) ).css( 'left' , 'auto' );
        });
    }).resize();
于 2018-01-12T19:09:22.893 回答
0

WordPress Visual Composer 全宽行(拉伸行)修复 RTL

jQuery(document).ready(function() {

function bs_fix_vc_full_width_row(){
    var $elements = jQuery('[data-vc-full-width="true"]');
    jQuery.each($elements, function () {
        var $el = jQuery(this);
        $el.css('right', $el.css('left')).css('left', '');
    });
}

// Fixes rows in RTL
jQuery(document).on('vc-full-width-row', function () {
    bs_fix_vc_full_width_row();
});

// Run one time because it was not firing in Mac/Firefox and Windows/Edge some times
bs_fix_vc_full_width_row();
});

资源

于 2018-01-24T14:26:17.070 回答