- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
查看堆叠背景图像时出现问题。所有图像都是黑色的。动画有效,但没有显示图像,请参阅代码片段中的代码,而未加载的 html 仅表示正在生效的 div。代码应具有此处的结果 https://tympanus.net/Tutorials/3DHoverEffects/index4.html然而,我们的效果很简单,但 img 是黑色的。我已经尝试了几种内联背景图像调用组合以及在 CSS 中,img 仍然没有显示任何想法或继承,我可能会遗漏影响这个的请让我知道。可根据要求提供完整代码
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
( function( $ ) {
$.fn.hoverfold = function( args ) {
this.each( function() {
$( this ).children( '.view' ).each( function() {
var $item = $( this ),
img = $item.children( 'img' ).attr( 'src' ),
struct = '<div class="slice s1">';
struct +='<div class="slice s2">';
struct +='<div class="slice s3">';
struct +='<div class="slice s4">';
struct +='<div class="slice s5">';
struct +='</div>';
struct +='</div>';
struct +='</div>';
struct +='</div>';
struct +='</div>';
var $struct = $( struct );
$item.find( 'img' ).remove().end().append( $struct ).find( 'div.slice' ).css( 'background-image', 'url(' + img + ')' ).prepend( $( '<span class="overlay" ></span>' ) );
} );
});
};
} )( jQuery );
/*--------------------------------------------------------------------------
General Style
--------------------------------------------------------------------------*/
body {
background: #FFFFFF;
}
.section {
padding: 30px 0;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-o-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
.section-white {
background: #FFF;
}
.section-dark {
background: #151515;
}
.section-dark h3 {
color:#FFF;
font-size:18px;
font-weight:200;
}
.section .container:first-child h1,
.section .container:first-child h2,
.section .container:first-child h3 {
margin-top: 0;
font-weight: 700;
}
.input-micro {
width: 50px;
margin-bottom: 0 !important;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
border-color: rgba(79, 141, 179, 0.8);
outline: 0;
outline: thin dotted \9;
/* IE6-9 */
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(79, 141, 179, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(79, 141, 179, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(79, 141, 179, 0.6);
color: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(79, 141, 179, 0.6);
}
ul.no-list-style {
list-style-type: none;
margin-left: 0;
}
ul.no-list-style li {
line-height: 28px;
}
div[class*="span"] {
-webkit-transition: all .4s linear;
-moz-transition: all .4s linear;
-o-transition: all .4s linear;
-ms-transition: all .4s linear;
transition: all .4s linear;
}
/*--------------------------------------------------------------------------
Typography Style
--------------------------------------------------------------------------*/
body {
font-family: Arial, 'Helvetica', sans-serif;
font-size: 14px;
line-height: 20px;
color: #535b60;
}
h1 {
color: #53555c;
font-family: 'Lato', sans-serif;
font-weight: 800;
}
h2 {
color: #53555c;
font-family: 'Lato', sans-serif;
font-size: 2em;
line-height: 1.5em;
margin: 30px 0 0 0;
}
h3 {
font-family: 'Lato', sans-serif;
color: #53555c;
font-size: 1.5em;
}
h4 {
font-family: 'Lato', sans-serif;
color: #53555c;
margin-bottom: 10px;
}
a {
color: #aec62c;
outline: 0;
}
a:hover {
color: #dcff21;
text-decoration:none;
outline: 0;
}
/*--------------------------------------------------------------------------
+ Services Style
--------------------------------------------------------------------------*/
/* Multicolumn */
.service-wrapper {
text-align: center;
color: 0 0 3px #999;
margin-bottom:30px;
}
.service-wrapper h3 {
font-size: 1.2em;
margin: 10px 0 !important;
}
.service-wrapper p {
margin-top: 0;
}
.service-wrapper i {
font-size:54px;
}
/* Row */
.service-wrapper-row {
padding: 10px 0;
}
.service-wrapper-row h3 {
padding-top: 15px;
}
.service-wrapper-row .service-image {
padding-top: 15px;
text-align: center;
}
.service-wrapper-row .service-image img {
max-width: 80%;
vertical-align: bottom;
bottom: 0;
border: 7px solid #FFF;
-webkit-border-radius: 5px;
-webkit-background-clip: padding-box;
-moz-border-radius: 5px;
-moz-background-clip: padding;
border-radius: 5px;
background-clip: padding-box;
-webkit-box-shadow: 0 0 8px #999;
-moz-box-shadow: 0 0 8px #999;
box-shadow: 0 0 8px #999;
color: 0 0 8px #999;
}
.view {
width: 316px;
height: 216px;
margin: 10px;
float: left;
position: relative;
border: 8px solid #fff;
box-shadow: 1px 1px 2px rgba(0,0,0,0.05);
-webkit-perspective: 500px;
-moz-perspective: 500px;
-o-perspective: 500px;
-ms-perspective: 500px;
perspective: 500px;
}
.view .slice{
width: 60px;
height: 100%;
z-index: 100;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
-ms-transform-origin: left center;
transform-origin: left center;
-webkit-transition: -webkit-transform 150ms ease-in-out;
-moz-transition: -moz-transform 150ms ease-in-out;
-o-transition: -o-transform 150ms ease-in-out;
-ms-transition: -ms-transform 150ms ease-in-out;
transition: transform 150ms ease-in-out;
}
.view div.view-back{
width: 50%;
height: 100%;
position: absolute;
right: 0;
background: #666;
z-index: 0;
}
.view-back span {
display: block;
float: right;
padding: 5px 20px 5px;
width: 100%;
text-align: right;
font-size: 16px;
color: rgba(255,255,255,0.6);
}
.view-back span:first-child {
padding-top: 20px;
}
.view-back a {
display: bock;
font-size: 18px;
color: rgba(255,255,255,0.4);
position: absolute;
right: 15px;
bottom: 15px;
border: 2px solid rgba(255,255,255,0.3);
border-radius: 50%;
width: 30px;
height: 30px;
line-height: 22px;
text-align: center;
font-weight: 700;
}
.view-back a:hover {
color: #fff;
border-color: #fff;
}
.view-back span[data-icon]:before {
content: attr(data-icon);
font-family: 'icons';
color: #aaa;
color: rgba(255,255,255,0.2);
text-shadow: 0 0 1px rgba(255,255,255,0.2);
padding-right: 5px;
}
.view .s2,
.view .s3,
.view .s4,
.view .s5 {
-webkit-transform: translate3d(60px,0,0);
-moz-transform: translate3d(60px,0,0);
-o-transform: translate3d(60px,0,0);
-ms-transform: translate3d(60px,0,0);
transform: translate3d(60px,0,0);
}
.view .s1 {
background-position: 0px 0px;
}
.view .s2 {
background-position: -60px 0px;
}
.view .s3 {
background-position: -120px 0px;
}
.view .s4 {
background-position: -180px 0px;
}
.view .s5 {
background-position: -240px 0px;
}
.view .overlay {
width: 60px;
height: 100%;
opacity: 0;
position: absolute;
-webkit-transition: opacity 150ms ease-in-out;
-moz-transition: opacity 150ms ease-in-out;
-o-transition: opacity 150ms ease-in-out;
-ms-transition: opacity 150ms ease-in-out;
transition: opacity 150ms ease-in-out;
}
.view:hover .overlay {
opacity: 1;
}
.view img {
position: absolute;
z-index: 0;
-webkit-transition: left 0.3s ease-in-out;
-o-transition: left 0.3s ease-in-out;
-moz-transition: left 0.3s ease-in-out;
-ms-transition: left 0.3s ease-in-out;
transition: left 0.3s ease-in-out;
}
/*--------------------------------------------------------------------------
+ hover effect
--------------------------------------------------------------------------*/
.view {
perspective: 1050px;
}
.view div {
transition: all 0.3s ease-in-out;
}
.view:hover .s2{
transform: translate3d(59px,0,0) rotate3d(0,1,0,-45deg);
}
.view:hover .s3,
.view:hover .s5{
transform: translate3d(59px,0,0) rotate3d(0,1,0,90deg);
}
.view:hover .s4{
transform: translate3d(59px,0,0) rotate3d(0,1,0,-90deg);
}
.view .s2 > .overlay {
background: linear-gradient(right, rgba(0,0,0,0.05) 0%,rgba(0,0,0,0) 100%);
}
.view .s3 > .overlay {
background: linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255, 255, 255, 0.2) 100%);
}
.view .s4 > .overlay {
background: linear-gradient(right, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.2) 100%);
}
.view .s5 > .overlay {
background: linear-gradient(left, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0) 100%);
}
.view div.view-back{
background: linear-gradient(left, #0a0a0a 0%,#666666 100%);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="section section-white">
<div class="container">
<div class="row">
<div class="section-title">
<h1>TOP SERVICES</h1>
</div>
<div id="grid" class="main">
<div class="view">
<div class="view-back">
<span data-icon="A">566</span>
<span data-icon="B">124</span>
<a href="http://www.flickr.com/photos/ag2r/5439506585/in/photostream">→</a>
</div>
<!-- <img src="img/portfolio/mobilem.jpg" />-->
<div class="slice s1" style="background-image: url(img/portfolio/mobilem.jpg); "><span class="overlay"></span>
<div class="slice s2" style="background-image: url(img/portfolio/mobilem.jpg); "><span class="overlay"></span>
<div class="slice s3" style="background-image: url(img/portfolio/mobilem.jpg); "><span class="overlay"></span>
<div class="slice s4" style="background-image: url(img/portfolio/mobilem.jpg); "><span class="overlay"></span>
<div class="slice s5" style="background-image: url(img/portfolio/mobilem.jpg); "><span class="overlay"></span>
</div><!-- /s5 -->
</div><!-- /s4 -->
</div><!-- /s3 -->
</div><!-- /s2 -->
</div><!-- /s1 -->
</div>
<div class="view">
<!-- ... -->
</div>
<!-- ... -->
</div>
<!-- begin snippet: js hide: false console: true babel: false -->
最佳答案
我有一个基本的 fiddle 可以工作。这可能是您图片的错误链接;这是我唯一改变的。尝试在 img
前添加斜杠。
background-image: url(/img/portfolio/mobilem.jpg);
关于jquery - 堆叠的 div 背景图像为黑色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50688509/
如何将单元格(在 UICollectionView 中)堆叠在一起? Feedly 做得很好,我想知道是否可以以某种方式操纵 zIndex 属性以在 UICollectionView 的导航中获得类似
我正在尝试堆叠 div 以使用和图像显示顶部和底部淡入淡出。 外部 div(“旋转器”)有一个背景图像,该图像在顶部和底部具有渐变,在中间是透明的。在中间,我想显示内容或图像,并将外部 div 背景图
我有两个动画(在 CSS 中)div,它们围绕彼此旋转。我想在中间为文本添加另一个 div。但是,如果我将 div 放在这两个中的任何一个中,它就会与父 div 一起设置动画。如果我尝试定位它,它就位
图中显示了我想要的 View 。 最佳答案 为此你可以采取 FrameLayout . 例如 - 1: 更新: 例如 - 2:精湛的示例和技巧,可在此处找到:http://w
使用 tf.keras.layers.RNN 的 TensorFlow (1.13.1) 中多层/堆叠 RNN 的初始状态所需的结构是什么? API? 我尝试了以下方法: lstm_cell_size
我在制作条形图时遇到问题,其中 y 轴不是计数,而是变量的值。 我使用stat=identity,这对于一个变量来说很好。但是,如果我有两个变量并且想要创建堆叠/闪避条形图怎么办? 我这里有一些模拟数
我有一个栅格路径列表(rplist = 912 raster pathe for 912 rasters (19yeras)(12months)(4weeks))如下: [1] "C:/Users
我已经完成了一个项目,现在需要更改该项目,以便在变量位于数组中时显示一个 div,如果变量不在数组中则显示另一个 div。 通常我会这么做 祝你愉快,但是我得到的代码已经包含大量 html 和 ph
我在制作条形图时遇到问题,其中 y 轴不是计数,而是来自变量的值。 我使用 stat=identity,这对一个变量来说没问题。但是,如果我有两个变量并想创建一个堆叠/闪避条形图怎么办? 我这里有一些
我有一个栅格路径列表(rplist = 912 raster pathe for 912 rasters (19yeras)(12months)(4weeks))如下: [1] "C:/Users
我正在尝试将分数和耗时标签(scoreAndTimer)添加到我已经工作的贪吃蛇游戏代码中。问题是当我使用 ScoreAndTimer.setText(); 时它与之前的文本堆叠在一起。 我尝试 se
有没有办法将 GTK+ 小部件放入堆栈中? IE。在标签上放置一个按钮,使按钮覆盖标签的一部分。 最佳答案 您可以使用 GtkFixed 作为布局。这将允许您控制子小部件的确切位置,并且它们可以重叠。
我有以下代码: for (Map.Entry e : classes.entrySet()) { ClassReader reader = e.getValue(); ClassWri
我正在尝试根据类别的计数(或比例)更改我的(堆叠)条宽,作为示例,我使用了钻石数据集。我想根据每个类别(变量 cut )的频率看到不同的宽度。我首先创建了一个变量 cut_prop然后用下面的代码绘制
我目前正在 UWP 中开展一个项目,我有一个 CommandBar,我想将其从 Hidden 变为 Compact 如果鼠标移动。五秒钟后(如果鼠标不移动)CommandBar 应该再次返回到Hidd
我是 Swift 新手,并尝试在学习过程中编写一本交互式书籍。我使用 CATransform3DMakeRotation 创建了封面效果。 正如您所看到的,当我堆叠 View 时,问题就出现了。如果我
我已经阅读了 finish(); 命令和 FLAG_ACTIVITY_CLEAR_TOP 命令,还查看了 Common Ware 关于终止应用程序的回答,但我不确定如何放置这进入我的应用程序。 基本上
在我的引擎中,我从成对的顶点/像素着色器文件中加载 Cg 着色器。我希望能够堆叠着色器以组合它们(照明+ Material 等)。除了将着色器分解为单独的函数然后从中创建单个着色器脚本字符串之外,您是
我有一个 Activity 应该自行完成并关闭应用程序。现在,在某些情况下,根据用户导航到 Activity 的方式而变化, Activity 正在堆叠。当 Activity 堆积时,然后调用 fin
我有 10 个具有完全相同的列和数据类型的 csv 文件。什么是最快/最有效的堆叠方式? CSV1: col1 | col2 | col3 1 | 'a' | 0.1 2 | 'b'
我是一名优秀的程序员,十分优秀!