- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在重新设计一个网站,并从 codrops 看到了这个蓝图:https://tympanus.net/codrops/2014/03/21/google-grid-gallery/ .我喜欢它的外观,并认为它真的可以帮助我的画廊脱颖而出。
我已经能够集成图库脚本和 WordPress,但模态窗口存在一个小问题。当您单击缩略图时,模态窗口将打开……您会看到标题、图片和一些文本。窗口的高度已设置,但一些文本不适合窗口,所以我决定启用滚动。
滚动适用于 Internet Explorer、Firefox 和 Google Chrome。不幸的是,滚动似乎在 Safari 中被禁用或锁定,我不确定是什么导致了这个问题。我很确定它与 css 有关系,但是在删除了这里那里的代码片段后,我无法找到罪魁祸首。
我正在进行的工作位于:http://www.joshrodg.com/test/
代码如下:
<div class="container">
<div id="grid-gallery" class="grid-gallery">
<section class="grid-wrap">
<ul class="grid">
<li class="grid-sizer"></li><!-- for Masonry column width -->
<li>
<figure>
<figcaption>
<h3>Alan Zinter</h3>
<a href="http://joshrodg.com/test/wp-content/uploads/img_043.jpg" rel="lightbox[80]"></a>
<p>
Inducted in 2009<br>
Four year letterman for Hanks High School<br>
All District and All City Honoree<br>
El Paso High School Player
</p>
</figcaption>
</figure>
</li>
</ul>
</section><!-- // grid-wrap -->
<section class="slideshow">
<ul>
<li>
<figure>
<figcaption>
<h3>Alan Zinter</h3>
<a href="http://joshrodg.com/test/wp-content/uploads/img_043.jpg" rel="lightbox[80]"></a>
<p>
Inducted in 2009<br>
Four year letterman for Hanks High School<br>
All District and All City Honoree<br>
El Paso High School Player of the Year in 1986 as a senior<br>
Had a .505 batting average<br>
Led the state in home runs with 15<br>
Led the state in runs batted in with 51<br>
Earned baseball scholarship from the University of Arizona<br>
As a freshman, he led the team with 7 triples in 1987<br>
Played in Alaska Collegiate League and led his team the Mat Su Miners to win the 1987 NBC World Series in Wichita Kansas<br>
His sophomore year at Arizona, he led the team in hits with 79 and led the Wildcats in runs batted in with 55<br>
Following his sophomore year he played in the Cape Cod League for the Harwich Mariners<br>
Played with Team USA in Taiwan – – 1988<br>
Led Team USA with a .412 batting average and helped lead them to a Silver Medal with a 6-1 record<br>
His junior year he tied the Arizona Wildcats team record with 18 home runs and led the team in runs batted in with 81 RBI and had a .352 batting average<br>
Named to the NCAA, Baseball America, The Sporting News and ABCA All American teams<br>
Named Pac 10 Conference “Co Player of the Year” with teammate pitcher Scott Erickson<br>
Finalist for 1989 Golden Spikes Award<br>
Led University of Arizona in hitting categories each of his three years playing in 162 games with 211 hits, 29 home runs, 357 total bases, 35 doubles, 12 triples, 172 RBI’s with a .336 batting average<br>
Chosen in the First Round, 24th overall selection by the New York Mets in the 1989 Professional Draft<br>
Played 19 seasons of professional baseball (1989-2007) with the Mets, Tigers, Red Sox, Mariners, Cubs, Diamondbacks, Astros and in Japan<br>
Named to All Star teams for Florida State League (1990) and Pacific Coast League (1997 and 1998)<br>
In his 19 seasons, he had 1,562 hits, 276 home runs, 1,013 runs batted in and a .257 batting average<br>
Made his major league debut in Milwaukee on June 18, 2002 against the Brewers while playing for the Houston Astros<br>
First Major League hit was a home run for the Astros against the Cincinnati Reds in 2002<br>
Played in Major Leagues for Astros and Arizona Diamondbacks organizations<br>
Hitting Coach for Arizona Diamondbacks minor league teams at Missoula and Visalia in 2008 and 2009
</p>
</figcaption>
</figure>
</li>
</ul>
<nav>
<span class="icon nav-prev"></span>
<span class="icon nav-next"></span>
<span class="icon nav-close"></span>
</nav>
</section><!-- // slideshow -->
</div><!-- // grid-gallery -->
</div>
CSS 看起来像:
/* Made with http://icomoon.io/app */
/* General style */
.grid-gallery ul {
list-style: none;
margin: 0;
padding: 0;
}
.grid-gallery figure {
margin: 0;
}
.grid-gallery figure img {
display: block;
height: auto;
width: 100%;
}
.grid-gallery figcaption h3 {
color: #cc0000;
font-size: 20px;
line-height: 25px;
padding: 0 0 10px;
text-align: center;
}
.grid-gallery figcaption p {
color: #084872;
margin: 0;
}
/* Grid style */
.grid-wrap {
max-width: 69em;
margin: 0 auto;
padding: 10px 1em 1.875em;
}
.grid {
margin: 0 auto;
}
.grid li {
width: 25%;
float: left;
cursor: pointer;
}
.grid figure {
padding: 15px;
-webkit-transition: opacity 0.2s;
transition: opacity 0.2s;
}
.grid li:hover figure {
opacity: 0.7;
}
.grid figcaption {
background: #e4e4e4;
padding: 25px;
}
/* Slideshow style */
.slideshow {
position: fixed;
background: rgba(0,0,0,0.6);
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 500;
opacity: 0;
visibility: hidden;
overflow: hidden;
-webkit-perspective: 1000px;
perspective: 1000px;
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
transition: opacity 0.5s, visibility 0s 0.5s;
}
.slideshow-open .slideshow {
opacity: 1;
visibility: visible;
-webkit-transition: opacity 0.5s;
transition: opacity 0.5s;
}
.slideshow ul {
width: 100%;
height: 100%;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform: translate3d(0,0,150px);
transform: translate3d(0,0,150px);
-webkit-transition: -webkit-transform 0.5s;
transition: transform 0.5s;
}
.slideshow ul.animatable li {
-webkit-transition: -webkit-transform 0.5s;
transition: transform 0.5s;
}
.slideshow-open .slideshow ul {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
.slideshow li {
width: 660px;
height: 560px;
position: absolute;
top: 50%;
left: 50%;
margin: -280px 0 0 -330px;
visibility: hidden;
}
.slideshow li.show {
visibility: visible;
}
.slideshow li:after {
content: '';
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(255,255,255,0.8);
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
}
.slideshow li.current:after {
visibility: hidden;
opacity: 0;
-webkit-transition: opacity 0.3s, visibility 0s 0.3s;
transition: opacity 0.3s, visibility 0s 0.3s;
}
.slideshow figure {
width: 100%;
height: 100%;
background: #fff;
border: 25px solid #fff;
overflow: auto;
}
.slideshow li figure img {
float: left;
margin-right: 15px;
width: auto;
max-width: 300px;
}
.slideshow figcaption {
padding-bottom: 20px;
}
.slideshow figcaption h3 {
color: #dd0000;
font-weight: 300;
font-size: 30px;
padding: 0 0 20px;
text-align: center;
}
.slideshow figcaption p {
overflow: hidden;
}
/* Navigation */
.slideshow nav span {
position: fixed;
z-index: 1000;
color: #59656c;
text-align: center;
padding: 3%;
cursor: pointer;
font-size: 2.2em;
}
.slideshow nav span.nav-prev,
.slideshow nav span.nav-next {
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.slideshow nav span.nav-next {
right: 0;
}
.slideshow nav span.nav-close {
top: 0;
right: 0;
padding: 0.5em 1em;
color: #31373a;
}
.icon:before,
.icon:after {
font-family: "Ionicons";
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
span.nav-prev:before {
content: "\f124";
}
span.nav-next:before {
content: "\f125";
}
span.nav-close:before {
content: "\f2d7";
}
/* Info on arrow key navigation */
.info-keys {
position: fixed;
top: 10px;
left: 10px;
width: 60px;
font-size: 8px;
padding-top: 20px;
text-transform: uppercase;
color: #fff;
letter-spacing: 1px;
text-align: center;
}
.info-keys:before,
.info-keys:after {
position: absolute;
top: 0;
width: 16px;
height: 16px;
border: 1px solid #fff;
text-align: center;
line-height: 14px;
font-size: 12px;
}
.info-keys:before {
left: 10px;
content: "\e603";
}
.info-keys:after {
right: 10px;
content: "\e604";
}
/* Example media queries (reduce number of columns and change slideshow layout) */
@media screen and (max-width: 60em) {
/* responsive columns; see "Element sizing" on http://masonry.desandro.com/options.html */
.grid li {
width: 33.3%;
}
.slideshow li {
width: 100%;
height: 100%;
top: 0;
left: 0;
margin: 0;
}
.slideshow li figure img {
width: auto;
margin: 0 auto;
max-width: 100%;
}
.slideshow nav span,
.slideshow nav span.nav-close {
font-size: 1.8em;
padding: 0.3em;
}
.info-keys {
display: none;
}
}
@media screen and (max-width: 35em) {
.grid li {
width: 50%;
}
}
@media screen and (max-width: 24em) {
.grid li {
width: 100%;
}
}
感谢任何帮助。
谢谢,
乔希
最佳答案
我最终选择一起删除 Lightbox,并坚持在使用滚动条的常规页面上加载内容 :-)
关于javascript - Google Grid Gallery Safari 模态滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48564532/
如果附加了 'not-scroll' 类,我希望我的 body 不滚动,否则它应该正常工作。 我已经搜索这个问题两天了,但找不到任何适合我的解决方案。 我想要的是向 body 添加一个 class,并
我发现似乎是 iOS Safari 中的错误(我正在 iOS 8 上进行测试)。当绝对定位的 iFrame 漂浮在一段可滚动内容上方时,滚动 iFrame 也会滚动下面的内容。以下 HTML (ava
我有以下代码来显示一系列投资组合图片,这些图片以 SVG 格式存储在滚动 div 中: 在 Safari 中滚动使用两根手指或鼠标滚轮当光标位于 SVG 之一上时不起作用。 该页
我想用 javascript 做的是: 一旦你向下滚动页面,将#sidebar-box-fixed 的位置从 position: relative; 更改为定位:固定;。改回position:rela
我对 Elasticsearch 的滚动功能有点困惑。在 elasticsearch 中,每当用户在结果集上滚动时,是否可以每次调用搜索 API?来自文档 "search_type" => "scan
我试图做到这一点,以便当我向上或向下滚动页面时,它会运行不同的相应功能。我发现了一个类似的问题here但我已经尝试了他们的答案并且没有运气。 注意:此页面没有正常显示的滚动条。没有地方可以滚动。 bo
(C语言,GTK库) 在我的表单上,我有一个 GtkDrawingArea 小部件,我在上面使用 Cairo 绘制 GdkPixbufs(从文件加载)。我想要完成的是能够在窗口大小保持固定的情况下使用
最近我一直在尝试创建一个拉到(刷新,加载更多)swiftUI ScrollView !!,灵感来自 https://cocoapods.org/pods/SwiftPullToRefresh 我正在努
我正在开发一个应用程序,其中有两个带有可放置区域的列表和一个带有可拖动项目的侧面菜单。 当我滚动屏幕时,项目的位置困惑。 我试图在谷歌上寻找一些东西,最后得到了这个问题:jQuery draggabl
我在 UIWebView 中加载了一个 HTML 表单,而我的 UIWebView 恰好从 View 的中间开始并扩展。我必须锁定此 webView 不滚动并将其放在 ScrollView 之上以允许
如何在每个元素而不是整个元素上应用淡入淡出(与其高度相比)? HTML: CSS: * { padding: 0; margin: 0; box-sizing: border
我想使用带有垂直轴的 PageView 并使用鼠标滚动在页面之间移动,但是当我使用鼠标滚动时页面不滚动...仅页面单击并向上/向下滑动时滚动。 有什么办法吗? 我想保留属性 pageSnapping:
我制作这个程序是为了好玩,但我被卡住了,因为程序在屏幕外运行。如何在不完全更改代码的情况下实现滚动条。 public static void main(String args[]) throws IO
我想使用带有垂直轴的 PageView 并使用鼠标滚动在页面之间移动,但是当我使用鼠标滚动时页面不滚动...仅页面单击并向上/向下滑动时滚动。 有什么办法吗? 我想保留属性 pageSnapping:
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
使用 jquery 技术从 css-tricks.com 获得滚动/跟随侧边栏,如果您不知道我在说什么,这里是代码: $(function() { var $sidebar = $
我是 jQuery Mobile 新手。我需要向我的应用程序添加 Facebook 滑动面板功能。 我经历了 sliding menu panel ,它工作正常,但我在菜单面板中的内容超出了窗口大小,
有没有办法在 js 或 jQuery 或任何其他工具中检测 ctrl + 滚动。我正在尝试执行一些动态布局代码,我需要检测不同分辨率下的屏幕宽度,我通过使用 setTimeout() 的计时器实现了这
我有一部分html代码:
我想控制 RichTextBox 滚动,但在控件中找不到任何方法来执行此操作。 这样做的原因是我希望当鼠标光标位于 RichTextBox 控件上时鼠标滚轮滚动有效(它没有事件焦点:鼠标滚轮事件由表单
我是一名优秀的程序员,十分优秀!