我为我的博主博客创建了我的第一个Hello World风格的Google Gadget,并且努力解决周围iframe的背景是白色的问题。我无法通过皮肤设置将其设置为透明,而不是将CSS添加到我的代码中,如下所示:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="hello world example" />
<Content type="html">
<![CDATA[
<div id="countdown"></div>
<script type="text/javascript">
// Get userprefs
var element = document.getElementById('countdown');
var text = '';
var today = new Date();
var BigDay = new Date("March 8, 2013");
var msPerDay = 24 * 60 * 60 * 1000;
var timeLeft = (BigDay.getTime() - today.getTime());
var e_daysLeft = timeLeft / msPerDay;
var daysLeft = Math.floor(e_daysLeft);
var e_hrsLeft = (e_daysLeft - daysLeft)*24;
var hrsLeft = Math.floor(e_hrsLeft);
var minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
element.innerHTML = text + '<span class="number">' + daysLeft + '</span>';
</script>
<style rel="text/css">
body {
background-color: transparent !important;
}
#countdown {
text-align: center;
font-size: 60px;
}
</style>
]]>
</Content>
</Module>
答案 0 :(得分:1)
哦,抱歉,这只是一个缓存问题,我在这里发布的解决方案实际上是有效的。在实际更新之前,您只需等待更多......