xhtml - 如何将移动版 Google 日历嵌入到移动网站中

标签 xhtml mobile embed google-calendar-api

我正在尝试将移动版本的 Google 日历嵌入到移动网站中,而无需登录。如果有人之前已经实现此功能或知道如何操作,请提供帮助。

最佳答案

以下是我对网站所做的操作,它非常适合我的 Google 日历需求。

我使用了 Google 日历嵌入代码,但我更改了在移动设备上嵌入的日历类型,以便内容适合屏幕。只要小容器的“&mode=”等于“AGENDA”,它就应该显示议程列表,但您可以直接从 Google 日历中复制该列表。

我对大容器使用了“月”日历嵌入选项,宽度设置为“100%”,高度设置为“650”,如下所示:

<div class="responsive-iframe-container big-container">
<iframe src="https://calendar.google.com/calendar/embed?
showTitle=0&showNav=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0&height
=700&wkst=1&bgcolor=%23db694f&src=123123123%40group.calendar.
google.com&color=%23fbdbac&ctz=America%2FLos_Angeles" style="border-width:0" 
width="100%" height="650" frameborder="0" scrolling="no"></iframe>
</div>

然后对宽度为“100%”、高度为“600”的移动设备使用“议程”日历嵌入选项,如下所示:

<div class="responsive-iframe-container small-container">
<iframe src="https://calendar.google.com/calendar/embed?
showTitle=0&showNav=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0
&mode=AGENDA&height=800&wkst=1&bgcolor=%23db694f&src=123123123
%40group.calendar.google.com&color=%23B1440E&ctz=America%2FLos_Angeles" 
style="border-width:0" width="100%" height="600" frameborder="0" 
scrolling="no"></iframe>
</div>

这将为您提供移动设备上的响应式 iFrame 议程列表,可以滚动浏览,同时在桌面上仍具有大型日历 View 。

最后,您需要将这些样式添加到页面

<style>
@media (max-width: 550px) {
   .big-container {
       display: none;
   }
}
@media (min-width: 550px) {
   .small-container {
       display: none;
   }
}
/* Responsive iFrame */
.responsive-iframe-container {
   position: relative;
   padding-bottom: 56.25%;
   padding-top: 30px;
   height: 0;
   overflow: hidden;
}
.responsive-iframe-container iframe,   
.responsive-iframe-container object,  
.responsive-iframe-container embed {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
}
</style>

关于xhtml - 如何将移动版 Google 日历嵌入到移动网站中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5925629/

相关文章:

CSS:删除图像周围的边框搞砸了图像定位

css - 为什么我不应该使用位置 :absolute for positioning everything?

javascript - 使用 jquery mobile 使用纬度和经度显示 map 位置

css - 手动拆分 css 命令

css - 嵌入 HTML YouTube 视频;显示不正确

css - 包含文本的 div 和包含图像的 div 的不同位置

css - 元素 "iframe"未定义 - 将此文档检查为 XHTML 1.0 Strict 时发现错误!

iphone - 使用 iPhone 浏览器处理搜索按钮?

javascript - 是否有用于表达公式的 DSL?

html - 需要移除 IE8 中显示的滚动条以用于嵌入播放器