【发布时间】:2015-09-23 19:35:42
【问题描述】:
在css中:
.regions-popup{
display:none;
}
html:
<svg width="0" height="0">
<defs>
<linearGradient id="textgradient10-1" x1="0%" x2="100%" y1="0%" y2="0%">
<stop stop-color="#880e7e" offset="0%"/>
<stop stop-color="#e1004b" offset="100%"/>
</linearGradient>
</defs>
</svg>
<div id="regions-popup">
<h3>
<svg class="svgtext">
<text font-size="24" fill="url(#textgradient10-1)" stroke="none">Text one</text>
</svg>
</h3>
</div>
稍后在代码中:
$("#regions-popup").show();
显示的 div 没有文本“Text One”。如何在需要时渲染文本,或者在开始时渲染并立即隐藏它
【问题讨论】:
-
display-none;?或display: none? -
您的代码表明您的 HTML 中只有
<linearGradient>标记。那是行不通的。它需要在<svg>中。 -
不,我没有包括它们,我觉得没有必要。编辑不当