- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我不确定这叫做什么,但是开发人员如何实现能够拥有一个空心的 Nexus 手机图像,然后在其中滚动内容?这是一种模拟产品在现实生活中如何工作的巧妙方法,那么如何实现呢?
这是一个例子,大约在页面的中间位置。
http://grupoweb.upf.edu/innova/q_kly/#step-6
@silversunhunter
我能够显示两个图像,但内容似乎完全遮住了父 div。我测量了图像并且尺寸是正确的 afaik。
CSS:
.nexus5-frame {
background: url(img/nexus5frame.png);
height:640px;
width:326px;
position: relative;
}
.nexus5-content {
overflow: scroll;
height: 515px;
width: 292px;
position: absolute;
left: 26px;
top 597px;
}
HTML:
<div class="col-lg-5 col-lg-offset-2 col-sm-6">
<div id="nexus5-frame">
<div id="nexus5-content">
<img src="img/content.png"/>
</div>
</div>
</div>
最佳答案
需要在父div中设置图片为背景图片。然后一个正确测量的内部绝对定位的 div 可以是您的可滚动内容。
<div id="main">
<div id="content"></div>
</div>
手机图片为345px × 661px
#main {
background: url(/filelocation) no-repeat;
height: 661px;
width: 345px;
position: relative;
}
屏幕为 305x601(假设)
#content {
overflow: auto; /*this gives us our scroll bar when the content is longer than the div*/
height: 601px;
width: 305px;
position: absolute;
left: 20px;
top: 30px;
}
关于javascript - 如何使用图像作为框架,并在里面滚动?在网站上模拟电话,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26171844/
在我的应用程序中,我使用 scrape(string url) 方法从网页中抓取链接。可以说它每次都返回我 10 个 url。 我想从每个抓取的 url 中抓取 10 个链接。 长话短说: (第 1
正如标题所说,我需要将 php 放入由 php 回显的 javascript 中 例如: if (something) then (some php)') ?> 这不是真正的代码,只是可能有助于理解
我有一个 ng-repeat 使用 ng-switch 来分隔 ng-repeat 内部的部分,我想在 ng-switch 组上应用一个 orderby 过滤器,但我似乎无法让它工作:
我是 shell 的新手。我不太了解以下功能。这个函数基本上把小时加1。 我想知道为什么开发人员在 $g_current_hour+1 前面放了“10#”。根据我的理解,shell 中的剂量 # 是指
为了在 MongoDB 中对元素进行分组和计数,我已经筋疲力尽了。有很多帖子,但没有一个是我需要的。 这是一个基于以下内容的示例: styvane answer db.VIEW_HISTORICO.a
int main() { int count = 0; string prev = " "; string current; while (cin>>current)
$0表示传递给swift闭包的第一个参数,是swift语言的语法糖。swift会自动为内联闭包提供速记参数名称,可使用$0,$1,$2等名称来引用闭包参数的值。 代码
我想把这个 If 放在宏中,但它总是给我一个错误。我不知道“或”用得是否正确。 Dim SMAT As String SMAT = "blahblahblah" (...) If Ce
这是 JSFiddle 链接:https://jsfiddle.net/fmdsu9Lo/ 我想添加一个悬停功能,以便将鼠标悬停在菜单上将在该菜单选项卡上应用 .current 样式,同时将其从当前打
是否可以在 SQL 中执行类似的操作? SELECT SUM(jobRequirements.number) as total, SUM(jobRequirements.number WHER
我有 3 个 SQL 表。 游戏 wo_tenis_partidos 选择 wo_tenis_pronosticos 配额 wo_tenis_cuotas_ha2 我需要获取满足两个条件的所有行: 条
我有这张乘客表日期: 这意味着在 Reservation 000004 中,有两个行程,分别是 Itinerary 0000010 (AAC Hangar - Anvaya Cove) 和 00000
里面
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 已关闭 9 年前。 此问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-topic在这里
我在模态框内显示一个弹出窗口,我可以在关闭时隐藏它,但在点击模态框外时无法隐藏它。我试着在关闭时隐藏它,这很好。代码在这里 $('.close, .close-button').click(funct
我所在的团队正在使用 MVC 架构开发 C# 程序。 当我完成 MVC 教程时,我有一些疑问。请帮我澄清一下这个疑惑。 1) Controller 可以对 View 进行哪些修改? 2)我认为所有 U
我正坐在一些通过#defines 生成大量代码的遗留代码上。现在我知道在 #define 中不可能有 #ifdef,但是 #if 可能吗?我想为特定类型添加一些特化。 (无需进行重大更改,例如使用模板
这是我试图用来创建触发器的代码: -- Dumping structure for trigger kavanga_lead.click_links_insert DROP TRIGGER IF EX
我想写这样的东西: #define COV_ON(x) \ #ifdef COVERAGE_TOOL \ _Pragma (CO
我在这样的定义的帮助下初始化一个结构数组: #define FLAGCODE(name) { #name, MNT_ ## name } struct { const char
我尝试将 css 和 jquery 应用于 div 元素,但它不接受 $(this) 参数。我想知道为什么我不能使用 $(this) 作为 div 元素的引用。 blabla.css({ 'top':
我是一名优秀的程序员,十分优秀!