gpt4 book ai didi

CSS 3D 转换 - 无法点击链接

转载 作者:行者123 更新时间:2023-11-28 09:49:40 27 4
gpt4 key购买 nike

我正在尝试在我的网页上添加 CSS 3D 转换效果,但我在卡片翻转后单击链接时遇到了一些问题。

问题

为什么会这样?
如何解决这个问题,以便我可以在翻转卡片后点击链接?

例子

http://jsfiddle.net/rbWFt/

代码

<!DOCTYPE html>
<html>
<head>
<title>Flipp</title>

<meta charset="utf-8">

<style>
.thumb
{
display:block;
width:300px;
height:340px;
position:relative;
margin:50px;
float:left;
}

.thumb-wrapper
{
display:block;
width:100%;
height:100%;
color: #A29088;
}

.thumb .thumb-front
{
width:100%;
height:100%;
position:absolute;
display:block;
background:#ff0;

}

.thumb .thumb-back
{
width:100%;
height:100%;
position:absolute;
display:block;
background:#f00;
}

/* Flipp effect */

.thumb.flip
{
-webkit-perspective: 800px;
-moz-perspective: 800px;
-ms-perspective: 800px;
-o-perspective: 800px;
perspective: 800px;
}

.thumb.flip .thumb-wrapper
{
-webkit-transition: -webkit-transform .35s;
-moz-transition: -moz-transform .35s;
-ms-transition: -moz-transform .35s;
-o-transition: -moz-transform .35s;
transition: -moz-transform .35s;

-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
}

.thumb.flip .thumb-wrapper.flipper,
.thumb.flip .thumb-front,
.thumb.flip .thumb-back
{
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
}

.thumb.flip .thumb-wrapper.flipper,
.thumb.flip .thumb-back
{
-webkit-transform: rotateY(-180deg);
-moz-transform: rotateY(-180deg);
-ms-transform: rotateY(-180deg);
-o-transform: rotateY(-180deg);
transform: rotateY(-180deg);
}

a
{
display: block;
width: 100%;
height: 100%;
}
</style>
</head>

<body>
<div class="thumb flip">
<div class="thumb-wrapper">
<div class="thumb-front">
</div>

<div class="thumb-back">
<a href="/">
Baz
</a>
</div>
</div>
</div>

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(function ()
{
// add/remove flip class that make the transition effect
$('.thumb.flip').hover(
function ()
{
$(this).find('.thumb-wrapper').addClass('flipper');
},

function ()
{
$(this).find('.thumb-wrapper').removeClass('flipper');
}
);
});
</script>
</body>
</html>

识别

这主要是以下教程的一部分:http://www.queness.com/post/11493/create-css-3d-transform-card-flip-gallery

最佳答案

我认为 backface-visibility 属性不需要在包装器上声明,只需在内部 div 上声明即可。如果您从 .thumb.flip .thumb-wrapper.flipper

中删除 backface-visibility 属性,它似乎可以工作

关于CSS 3D 转换 - 无法点击链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18514576/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com