我遇到了一个奇怪的问题,幻灯片在我们的公司网站上,我还没有搞清楚什么是和。在Joomla更新到3.7.2,其中php回显url之后,我有以下内容:
而不是:
style="background-image: url("images/sliders/slide-1.jpg");It输出:
style="background-image: url(" images sliders slide-1.jpg");幻灯片的脚本具有以下Vars:
$ctaImg = $helper->get('img');
$ctaBackground = 'background-image: url("'.$ctaImg.'"); background-attachment: fixed; background-repeat: no-repeat; background-size: cover;';在背景图像url上应用img的行是:
<div class="acm-cta style-5 <?php echo $helper->get('style'); ?> <?php if($ctaImg): echo 'bg-image-large'; endif; ?>" <?php if($ctaImg): echo 'style="'.$ctaBackground.'"'; endif; ?> >使用var-dump,我有以下输出:
<!-- Var1: string(33) "images/sliders/slide-1.jpg"
Var2: string(143) "background-image: url("images/sliders/slide-1.jpg"); background-attachment: fixed; background-repeat: no-repeat; background-size: cover;"
-->要素:

资料来源:

在选项卡中的Developer Tools中,url中缺少斜杠,但在源代码中,url是正确的。它把我逼疯了..。
发布于 2017-06-14 14:46:55
要解决这个问题,只需从背景图像中删除引号: url("")
在检查器中,您的代码看起来:
style="background-image: url("/images/sliders/slide-1.jpg");"并且应该
style="background-image: url(/images/sliders/slide-1.jpg);https://stackoverflow.com/questions/44262564
复制相似问题