Wordpress Visual Composer Strech行和方向RTL
问题描述:
当我尝试在Visual Composer中的行设置中拉伸行时,行会拉伸,但行的位置都是错误的。 只有当身体方向有direction:rtl
css设置时才会发生。Wordpress Visual Composer Strech行和方向RTL
网站在线:http://ono.devurl.net/?page_id=871
固定是什么办法?
答
Yuval嘿!
试试这个脚本来解决你的问题。
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中(窗口).load。
希望这会帮助你:)
答
可能是更容易使用CSS来解决这个问题,当页面被调整过它会工作。 查找排课前[数据VC-全宽=“真”]和CSS等添加到您的rtl.css
.before-fullwidth-row {
direction: ltr;
}
.before-fullwidth-row > div {
direction: rtl;
}
似乎工作...
答
如果你想固定VC行也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的视觉作曲全宽的行(行stretche)定出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();
});
不错,但是在调整大小时仍然存在问题:( – Iggy