使用浏览器书签预览网站在显示屏显示不同尺寸的效果代码分享
首页>>技术教程>>正文
本篇文章更新于 2021-11-07 12:49:27
本篇文章更新于 2021-11-07
使用浏览器书签预览网站在显示屏显示不同尺寸的效果代码分享

效果图

使用浏览器书签预览网站在显示屏显示不同尺寸的效果代码分享

代码

javascript:document.write('
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
iframe { margin: 0 20px 20px 0; border: 1px solid #666; }
</style>
</head>
<body>
<div class="wrapper">
<div class="frame">
<h2>240<span> x 320</span> <small>(mobile)</small></h2>
<iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="240" height="320"></iframe>
</div>
<div class="frame">
<h2>320<span> x 480</span> <small>(mobile)</small></h2>
<iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="320" height="480"></iframe>
</div>
<div class="frame">
<h2>480<span> x 640</span> <small>(small tablet)</small></h2>
<iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="480" height="640"></iframe>
</div>
<div class="frame">
<h2>768<span> x 1024</span> <small>(tablet - portrait)</small></h2>
<iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="768" height="1024"></iframe>
</div>
<div class="frame">
<h2>1024<span> x 768</span> <small>(tablet - landscape)</small></h2>
<iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="1024" height="768"></iframe>
</div>
<div class="frame">
<h2>1200<span> x 800</span> <small>(desktop)</small></h2>
<iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="1200" height="800"></iframe>
</div>
</div>
</body>
</html>
')

食用方法

这里以360浏览器为例。在收藏管理添加一个网页

使用浏览器书签预览网站在显示屏显示不同尺寸的效果代码分享

设置好了 点击一个网页加载好在点击书签即可预览不同尺寸(尺寸可以修改的)
上面的 js 代码中,下面就对应的每个自适应窗口屏幕参数,自行修改即可。width=”1200″代表宽度1200px,height=”800″代表高度为800px;此外,你可以添加更多屏幕。

[yx_embed_post ids=1878,1745]

历史上的今天

很遗憾~,历史上的今天未发表过文章
技术教程

【网站美化】鼠标特效鼠标点击出现文字效果

2021-11-7 12:41:02

技术教程

WordPress纯代码实现文章内容微信关注后获取验证码可见

2021-11-7 13:11:08

重要说明

本站资源大多来自网络,如有侵犯你的权益请联系管理员或给邮箱发送邮件zhouqiuqiu123@foxmail.com 我们会第一时间进行审核删除。站内资源为网友个人学习或测试研究使用,未经原版权作者许可,禁止用于任何商业途径!请在下载24小时内删除!


如果遇到评论下载的文章,评论后刷新页面点击对应的蓝字按钮即可跳转到下载页面本站资源少部分采用7z压缩,为防止有人压缩软件不支持7z格式,7z解压,建议下载7-zip(点击下载),zip、rar解压,建议下载WinRAR(点击下载)

敏而好学,不耻下问。——孔子