gpt4 book ai didi

javascript - 单击按钮时如何显示我的定价表?

转载 作者:行者123 更新时间:2023-11-28 14:09:51 25 4
gpt4 key购买 nike

我正在建立一个网站,我想为我的价格表制作一个精美的动画,当您点击它们的名字时它们就会出现。可以看网站here .

我已经试过了 this code来自 W3 Schools 的关于如何制作 Accordion 并将“面板”类包装在我的定价表上的信息,但对我来说没有用,你有什么建议吗?下面是我的定价表的代码及其样式。对于网站上的信息,所有定价框都使用相同的代码。

.first-titre-table {
color: black;
font-size: 40px;
font-family: 'Open Sans';
}

.titre-table {
margin-top: 50%;
color: black;
width: auto;
height: auto;
font-size: 40px;
font-family: 'Open Sans';
}

@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,700);

.snip1404 {
font-family: 'Open Sans';
color: #ffffff;
text-align: left;
font-size: 16px;
max-width: 1000px;
left: 20%;
margin-right: auto;
width: 100%;
padding: 10px;
margin-top: 7%;
display: block;
flex-wrap: wrap;
align-content: center;
position: relative;
}

.snip1404 img {
position: absolute;
left: 0;
top: 0;
height: 100%;
z-index: -1;
}

.snip1404 .plan {
margin: 6px;
margin-top: 7px;
width: 25%;
position: relative;
float: left;
overflow: hidden;
border: 5px solid #730000;
box-shadow: 0px 0px 10px #000;
background-color: #b30000;
}

.snip1404 .plan:hover {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}

.snip1404 * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
}

.snip1404 header {
background-color: #b30000;
color: #ffffff;
}

.snip1404 .plan-title {
background-color: rgba(0, 0, 0, 0.5);
position: relative;
margin: 0;
padding: 20px 20px 0;
text-transform: uppercase;
letter-spacing: 4px;
}

.snip1404 .plan-title::after {
position: absolute;
content: '';
top: 100%;
left: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 40px 300px 0 0;
border-color: rgba(0, 0, 0, 0.5) transparent transparent;
}

.snip1404 .plan-cost {
padding: 40px 20px 10px;
text-align: right;
}

.snip1404 .plan-price {
font-weight: 600;
font-size: 3em;
}

.snip1404 .plan-type {
opacity: 0.8;
font-size: 0.9em;
text-transform: uppercase;
}

.snip1404 .plan-features {
padding: 0 0 20px;
margin-left: 10px;
list-style: outside none none;
text-align: center;
}

.snip1404 .plan-features li {
padding: 8px 5%;
}

.snip1404 .plan-features i {
margin-right: 8px;
color: rgba(0, 0, 0, 0.5);
}

.snip1404 .plan-select {
border-top: 1px solid rgba(0, 0, 0, 0.2);
padding: 20px;
text-align: center;
}

.snip1404 .plan-select a {
background-color: #700000;
color: #ffffff;
text-decoration: none;
padding: 12px 20px;
font-size: 0.75em;
font-weight: 600;
border-radius: 20px;
text-transform: uppercase;
letter-spacing: 4px;
display: inline-block;
}

.snip1404 .plan-select a:hover {
background-color: #ff4d4d;
}

.text-garantie {
font-size: 17px;
display: inline;
color: #fff;
font-weight: bold;
text-shadow: 0px 0px 7px #ddd;
}

@media only screen and (max-width: 767px) {
.snip1404 .plan {
width: 50%;
}

.snip1404 .plan-title,
.snip1404 .plan-select a {
-webkit-transform: translateY(0);
transform: translateY(0);
}

.snip1404 .plan-select,
.snip1404 .plan-featured .plan-select {
padding: 20px;
}

.snip1404 .plan-featured {
margin-top: 0;
}
}

@media only screen and (max-width: 440px) {
.snip1404 .plan {
width: 100%;
}

.snip1404 .plan-non-featured {
width: 100%;
}

.snip1404 .plan-featured {
width: 100%;
}
}
<div class="snip1404">
<h2 class="first-titre-table">
Contrats Chaudière Gaz
</h2>
<div class="plan">
<header>
<h4 class="plan-title">
Contrat 1 an
</h4>
<div class="plan-cost">
<span class="plan-price">
188€
</span>
<span class="plan-type">
/an
</span>
</div>
</header>
<ul class="plan-features">
<li>
1 intervention/an
</li>
<li style="margin-bottom:63%;">
</li>
</ul>
<div class="plan-select">
<a href="">
Choisir
</a>
</div>
</div>
</div>

我想尽可能保持这个网站的框架免费,因为我不知道当我尝试将它托管在我公司的服务器上时它会如何表现,所以请在回答之前考虑这一点,谢谢!

最佳答案

$('.first-titre-table').click(function(){
$(this).next('.plan').slideToggle()
})

如果我理解你的话,这个 jQuery 会做你想做的事。当然,你需要先隐藏它。

.plan{
display: none;
}

关于javascript - 单击按钮时如何显示我的定价表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56680862/

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