响应式PhotoSwipe与移动设备上的大控制
Responsive PhotoSwipe with large controls on mobile device
在这个官方代码中,在我的移动设备上控件和标题看起来非常小:http://codepen.io/dimsemenov/pen/ZYbPJM
我试着把这个添加到HTML中,但是没有任何区别:
<meta name="viewport" content="width = device-width, initial-scale = 1.0">
我怎么能让他们更大,就像在photoswipe.com网站?
如果你的标记看起来像PhotoSwipe网站和CodePen建议的那样,你可以简单地在figcaption
元素中添加任何你喜欢的HTML元素,如下所示:
<div class="my-gallery" itemscope itemtype="http://schema.org/ImageGallery">
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="img/dektop/1.jpg" itemprop="contentUrl" data-size="1200x1202">
<img src="img/thumb/1.jpg" itemprop="thumbnail" alt="Image description" />
</a>
<figcaption itemprop="caption img-description">
<div class="index">
<div class="img-title">
Title of the image or photo
</div>
<div class="img-year">
2003
</div>
<div class="dimensions">
1200 x 900 cm
</div>
<div class="technique">
Oil on cotton
</div>
</div>
</figcaption>
</figure>
,然后使用以下CSS样式的标题,例如:
.img-title {
font-size: 2em;
}
.img-year {
font-size: 1.2em;
}
.dimensions {
font-size: 1em;
}
.technique {
font-size: 0.8em;
}
如果你对默认值不满意,你也可以在手机和平板电脑的标题样式类中添加媒体查询。
@media screen and (min-width:0px) {
.img-title {
font-size: 2em;
}
.img-year {
font-size: 1.2em;
}
.dimensions {
font-size: 1em;
}
.technique {
font-size: 0.8em;
}
}
@media screen and (min-width:320px) {
.img-title {
font-size: 4em;
}
.img-year {
font-size: 2.2em;
}
.dimensions {
font-size: 1.5em;
}
.technique {
font-size: 1.1em;
}
}
记住包括所有的JS和CSS文件,如下所示:
http://photoswipe.com/documentation/getting-started.html
<!-- Core CSS file -->
<link rel="stylesheet" href="path/to/photoswipe.css">
<!-- Skin CSS file (styling of UI - buttons, caption, etc.)
In the folder of skin CSS file there are also:
- .png and .svg icons sprite,
- preloader.gif (for browsers that do not support CSS animations) -->
<link rel="stylesheet" href="path/to/default-skin/default-skin.css">
<!-- Core JS file -->
<script src="path/to/photoswipe.min.js"></script>
<!-- UI JS file -->
<script src="path/to/photoswipe-ui-default.min.js"></script>
我也遇到了这个问题PhotoSwipe: edit parseThumbnailElements函数来解析额外的标记元素,我为你链接它,看看如何用PhotoSwipe项目和这个精确的HTML标记构建一个响应式画廊网格,也用于你在你的问题中链接的CodePen
相关文章:
- JS编译器/包管理器,用于版本控制
- 是否可以控制获取哪些Google地图脚本(JavaScript API)
- 三星智能电视应用程序;Brightcove示例应用程序远程控制问题
- 如何控制组件'的createContent函数被激发
- 节点协同与生成器和Promise并行流量控制
- 否'访问控制允许来源'标头存在于IISNOde中请求的资源(AngularJS+NodeJs)上
- 使用:new Image()控制加载html.src=html_URL
- 传单缩放控制位置错误
- Node.js使用Series函数(模式?)实现流控制时出现意外结果
- 如果类不是一个选项,如何在使用 jQuery 时控制(避免)嵌套 html 元素的样式
- 使用jQuery控制来自图像的音频
- CORS:否'访问控制允许来源'header-但是php设置头文件
- "访问控制允许起源”;通过javascript从http页面调用同一网站的httpsurl时出现问题
- 为什么可以't我将检索到的文档分配给控制台中的变量
- CORS:访问控制允许原点不等于提供的原点
- javascript window.open将无法在Chrome控制台上工作
- onmousedown更改光标;可能需要控制事件冒泡
- 飞行前响应中的访问控制允许标头不允许Angularjs请求标头字段访问控制允许标题
- django没有访问控制允许删除原始标头
- 响应式PhotoSwipe与移动设备上的大控制