- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Fox News</title>
<link rel="icon" href="https://s2.googleusercontent.com/s2/favicons?domain_url=http://foxnews.com" type="image/gif" sizes="16x16">
<style>
body {
margin: auto;
}
.iframe-container {
position: relative;
height: 100%;
}
.iframe-container iframe,
.iframe-container object,
.iframe-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
margin: 0px;
border: 0;
}
.social-magnet {
position: fixed;
left: 10px;
font-family: 'Source Sans Pro', sans-serif;
}
.clx_iframe {
position: absolute;
display: block;
bottom: 30px;
left: 5%;
width: 100%;
height: 100px;
font-family: sans-serif;
}
.socialbar {
width: 87px;
height: 87px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
border: none;
pointer-events: fill;
box-shadow: none;
z-index: 101;
position: absolute;
top: 35%;
left: 147px;
border-radius: 50% !important;
}
.profilePhoto {
width: 87px;
height: 87px;
border-radius: 50%;
border: 3px dashed lightgray;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
object-fit: contain;
}
.messageContainer {
width: 390px;
height: auto;
line-height: 18px;
padding: 10px 15px 10px 15px;
font-size: 16px;
border: 2px solid white;
border-radius: 5px;
position: absolute;
text-align: center;
color: black;
background-color: white;
text-shadow: none;
pointer-events: fill;
box-shadow: none;
opacity: 1;
z-index: 100;
}
.circle-div {
background: #4C4E60;
height: 20px;
border-radius: 50% !important;
width: 20px;
float: right;
position: relative;
top: -20px;
right: -25px;
color: white;
}
#minimizeToggle {
color: white;
opacity: 0.75;
cursor: pointer;
font-weight: bolder;
font-size: 13px;
text-decoration: none;
}
#logosocial {
float: right;
text-decoration: none;
padding-right: 2.5px;
padding-left: 2.5px;
}
.logoImage {
width: 46px;
height: 20px;
margin-top: -5px;
background-repeat: no-repeat;
background-size: 100%;
opacity: 0.6;
position: relative;
right: -25px;
}
#profileName {
width: 77%;
line-height: 20px;
font-size: 15px;
padding-bottom: 3px;
text-align: left;
color: rgb(34, 34, 34);
display: block;
opacity: 0.6;
overflow: hidden;
white-space: nowrap;
text-decoration: none;
font-weight: bold;
}
#message {
height: 36px;
margin-top: 4px;
display: table;
text-align: left;
overflow: hidden;
width: auto;
letter-spacing: 0.5px;
color: rgb(34, 34, 34);
}
#messageText {
height: auto;
width: 100%;
display: table-cell;
vertical-align: middle;
font-weight: 400;
font-size: 14px;
color: rgb(34, 34, 34);
word-wrap: break-word;
word-break: break-all;
}
#formButton {
float: right;
margin-left: 15px;
cursor: pointer;
color: rgb(255, 255, 255);
background-color: #4C4E60;
width: 90%;
}
.triangle {
box-sizing: border-box;
background: white;
box-shadow: 0px 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.triangle::after {
content: "";
position: absolute;
width: 0;
height: 0;
margin-left: -0.5em;
bottom: -2em;
left: 45%;
box-sizing: border-box;
border: 1em solid black;
border-color: transparent transparent white white;
transform-origin: 0 0;
transform: rotate(-45deg);
box-shadow: -3px 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.buttonCTA {
height: 36px;
width: auto;
display: table-cell;
padding: 0 15px 0 15px;
margin: 0 0 0 15px;
border-radius: 5px;
border: 3px solid #4C4E60;
line-height: 35px;
font-weight: 400 !important;
text-decoration: none;
text-align: center;
}
/* Media Queiries */
@media screen and (max-width: 359px) and (min-width: 320px) {
.messageContainer {
width: 300px;
}
.socialbar {
left: 107px;
}
}
@media screen and (max-width: 374px) and (min-width: 360px) {
.messageContainer {
width: 340px;
}
.socialbar {
left: 125px;
}
}
@media screen and (max-width: 413px) and (min-width: 375px) {
.messageContainer {
width: 355px;
}
.socialbar {
left: 133px;
}
}
</style>
</head>
<body>
<div id="iframeWrapper" class="iframe-container">
<iframe id="website_frame" class="iframe" src="https://foxnews.com" sandbox='allow-forms allow-scripts allow-same-origin' allowfullscreen></iframe>
<div class="social-magnet">
<div class="messageContainer triangle">
<div class="circle-div"><a id="minimizeToggle" href="http://foxnews.com">x</a></div>
<a id="logosocial" href="https://clickx.io?utm_source=http://www.clickx.io&utm_campaign=contact&utm_medium=offerwidget" target="_blank">
<div class="logoImage"></div>
<a id="profileName" href="http://foxnews.com" target="_blank">Kannan Devan</a>
</a>
<span id="message">
<span id="messageText" class="text-left">
Good evening. Spent the Evening with a cup of TEA
</span>
</span>
<a class="buttonCTA" id="formButton" href="http://foxnews.com" target="_blank">
Hello Guys
</a>
</div>
<span class="socialbar">
<a id="imageLink" href="http://foxnews.com" target="_blank">
<img id="image_src" class="profilePhoto" src='https://ffb2efd5105ff0aedbc9-9cdacdeebf0faa19b665bf427f0c8092.ssl.cf1.rackcdn.com/assets/new-creator/plus-icon4.png' alt="Brand Logo">
</a>
</span>
</div>
</div>
<script type="text/javascript" charset="utf-8">
var wrapper = document.getElementsByClassName('social-magnet')[0];
var image_wrapper = document.getElementsByClassName('socialbar')[0];
var height = document.getElementsByClassName('messageContainer')[0].offsetHeight;
wrapper.style.bottom = (height + 132).toString() + 'px';
image_wrapper.style.marginTop = (height + 40).toString() + 'px';
</script>
</body>
</html>
我尝试使用 iFrame 在纯 HTML 页面中加载网站。
在桌面上打开时,将打开站点的桌面版本。此外,在 Android 手机中打开时,会加载移动版本,这是预期的行为。
但问题是,在 iPhone 中打开时,会加载网站的桌面版本。
最佳答案
设置 iFrame 属性 scrolling='no'
使其看起来像在 iOS 上正确加载网站的移动版本。
var ifrm = document.createElement("iframe");
ifrm.setAttribute("src", "<%= @social_snip.url %>");
ifrm.id = 'ContentFrame';
ifrm.scrolling = 'yes';
if (check) {
document.getElementById('iframeWrapper').className += ' mobile-theme';
}
var IOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if(IOS) {
ifrm.scrolling = 'no';
}
以上代码检查操作系统是否为 iOS,如果是,它将设置 iFrame 的 scrolling
属性为 no
值。
关于javascript - 元视口(viewport)标签选项在 iOS 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44878131/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!