当我尝试在 Visual Composer 的行设置中拉伸行时,行会拉伸,但行的位置都是错误的。仅当身体方向具有direction:rtl
css 设置时才会发生。
网站上线:http ://ono.devurl.net/?page_id=871
有什么办法解决吗?
当我尝试在 Visual Composer 的行设置中拉伸行时,行会拉伸,但行的位置都是错误的。仅当身体方向具有direction:rtl
css 设置时才会发生。
网站上线:http ://ono.devurl.net/?page_id=871
有什么办法解决吗?
尤瓦尔嘿!
试试这个脚本来解决你的问题。
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 中。
希望这会帮助你:)
使用css可能更容易解决它,并且在调整页面大小时它也可以工作。在 [data-vc-full-width="true"] 之前为行找到一个类并将此类 css 添加到您的 rtl.css
.before-fullwidth-row {
direction: ltr;
}
.before-fullwidth-row > div {
direction: rtl;
}
似乎工作...
如果您还想修复 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();
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();
});