![](/img/trans.png)
[英]Javascript for scrolling to the top of selected panel in customised accordion
[英]Accordion Panel Content Not Scrolling
美好的一天,
我的网站出现了一个很奇怪的问题。 我正在尝试将Time.ly Calendar小部件放置在手风琴的一个面板中。 如果您在“游戏: http ://www.rthhockey.com/onehockey”下查看此页面,它将完全按照我的意愿进行渲染。问题是,如果您在此处查看, 请访问http://www.rthhockey.com。 / tcs-hockey ,我只是从工作页面复制并粘贴代码,而只是替换日历脚本,它没有按预期滚动。在另一页上, http://www.rthhockey.com/canlan ,我只能说,日历脚本是唯一可以更改的东西,只是组织者编号在更改,这对我来说很奇怪,但也许有些专业人士可能会更改一种简单的解决方案,我尝试过使用面板和手风琴的高度都无济于事,在此先感谢您可能提供的任何帮助。
CSS
.ac-container {
max-width: 810px;
}
.ac-container label {
height: 50px !important;
line-height: 50px !important;
font-size: 26px !important;
font-family: 'Open Sans';
padding: 5px 15px;
position: relative;
z-index: 20;
display: block;
height: 30px;
cursor: pointer;
color: #ff6600;
line-height: 50px;
font-size: 26px;
background: #ffffff;
font-size: 26px;
height: 30px;
line-height: 50px;
border: 1px solid #ff6600;
}
.ac-container {
width: 100%;
margin: 10px auto 30px auto;
text-align: left;
}
.ac-container label:hover {
background: #fff;
}
.ac-container input:checked + label,.ac-container input:checked + label:hover {
background: #ffffff;
color: #ff6600;
height: 30px;
line-height: 21px;
font-size: 13px;
}
.ac-container label:hover:after,.ac-container input:checked + label:hover:after {
content: '';
position: absolute;
width: 24px;
height: 24px;
right: 13px;
top: 7px;
background: none;
}
.ac-container input:checked + label:hover:after {
background-image: none;
}
.ac-container input {
display: none;
}
.ac-container article {
background: #ffffff;
margin-top: -5px;
overflow: hidden;
height: 0;
position: relative;
z-index: 10;
-webkit-transition: height 0.3s ease-in-out,box-shadow 0.6s linear;
-moz-transition: height 0.3s ease-in-out,box-shadow 0.6s linear;
-o-transition: height 0.3s ease-in-out,box-shadow 0.6s linear;
-ms-transition: height 0.3s ease-in-out,box-shadow 0.6s linear;
transition: height 0.3s ease-in-out,box-shadow 0.6s linear;
}
.ac-container article p {
font-style: normal;
color: #494949;
line-height: 23px;
font-size: 10px;
padding: 5px;
font: normal normal 12px 'Open Sans';
}
.ac-container input:checked ~ article {
-webkit-transition: height 0.5s ease-in-out,box-shadow 0.1s linear;
-moz-transition: height 0.5s ease-in-out,box-shadow 0.1s linear;
-o-transition: height 0.5s ease-in-out,box-shadow 0.1s linear;
-ms-transition: height 0.5s ease-in-out,box-shadow 0.1s linear;
transition: height 0.5s ease-in-out,box-shadow 0.1s linear;
box-shadow: 0 0 0 1px rgba(155,155,155,0.3);
}
.ac-container input:checked ~ article.ac-small {
height: 390px;
}
.ac-container input:checked ~ article.ac-medium {
height: 420px;
}
.ac-container input:checked ~ article.ac-large {
height: 230px;
}
div.scroll {
max-height: 1250px;
overflow: auto;
}
.timely-stream:not(.timely-agenda) .timely-event {
min-height:92px; !important
}
.timely-title-text,
.timely-details-container{
font-size:67%;
}
HTML
<section class="ac-container">
<div>
<input id="ac-1" name="accordion-1" type="radio" >
<label for="ac-1">TOURNAMENTS</label>
<article class="ac-small">
<div class="scroll">
<script src="//dashboard.time.ly/js/embed.js" data-src="https://events.time.ly/hye2ww2?categories=21029&organizers=43496" data-max-height="0" id="timely_script" class="timely-script"></script>
</div>
</article>
</div>
<div>
<input id="ac-2" name="accordion-1" type="radio" checked="">
<label for="ac-2">OneHockey</label>
<article class="ac-medium">
<a href="http://www.rthhockey.com" target="_blank"><img src="https://i.imgur.com/HJwXuym.png?2" title="OneHockey Events" /></a>
</article>
</div>
<div>
<input id="ac-3" name="accordion-1" type="radio">
<label for="ac-3">INFO</label>
<article class="ac-large">
Blah, blah, blah
</article>
</div>
</section>
The 3 differnt script codes that I've used with the 1st being the one that is working:
<script src="//dashboard.time.ly/js/embed.js" data-src="https://events.time.ly/hye2ww2?categories=21029&organizers=43496" data-max-height="0" id="timely_script" class="timely-script"></script>
<script src="//dashboard.time.ly/js/embed.js" data-src="https://events.time.ly/hye2ww2?categories=26034&organizers=46341" data-max-height="0" id="timely_script" class="timely-script"></script>
<script src="//dashboard.time.ly/js/embed.js" data-src="https://events.time.ly/hye2ww2?categories=21029&organizers=43496" data-max-height="0" id="timely_script" class="timely-script"></script>
该div需要应用“溢出:滚动”。
文章class =“ ac-small”
示例:article.ac-small {溢出:滚动;}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.