gpt4 book ai didi

javascript - Angular 2 : Programmatically to position inside div overlay

转载 作者:行者123 更新时间:2023-12-03 05:32:01 26 4
gpt4 key购买 nike

我定制了一个PrimeNg TabView并将其包装在自定义组件中以实现此目的:

My TabView Component

正如您所看到的,选项卡 View 内容具有 overflow-x:hidden ,因此它看起来更好,为了允许用户在隐藏的选项卡之间导航,我添加了两个按钮,每一侧一个标签 View 的。

现在我正在尝试开发这些按钮的点击功能,但我不知道如何实现这一点。

这就是我的组件的样子:

<div class="wrapper">
<a id="back" class="ripple" [style.backgroundColor]="ui.currentThemeBackground"><i class="material-icons">chevron_left</i></a>
<p-tabView styleClass="tab-container" [style]="{'background-color':ui.currentThemeBackground}">
<p-tabPanel *ngFor="let tab of store.linhaTempo | async; let i = index; "
[id]="index" [header]="tab.titulo" [selected]="tab.selecionada"></p-tabPanel>
</p-tabView>
<a id="forward" class="ripple" [style.backgroundColor]="ui.currentThemeBackground"><i class="material-icons">chevron_right</i></a>
</div>


linha-tempo .wrapper {
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
-moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
-o-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
-webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
position: fixed;
top: 55px;
width: 100%;
}

linha-tempo .tab-container {
border: none !important;
margin: 0 auto;
width: calc(100% - 80px);
border-radius: 0px;
}

linha-tempo #back, linha-tempo #forward {
width: 40px;
position: fixed;
top: 55px;
line-height: 33px;
text-align: center;
cursor: pointer;
}

linha-tempo #back {
left: 0px;
}

linha-tempo #forward {
right:0px;
}

linha-tempo #back i, linha-tempo #forward i {
line-height: 2;
color: white;
}

linha-tempo .ui-tabview-panel {
display: none !important;
}

linha-tempo .ui-tabview-nav, linha-tempo .ui-tabview-nav > li.ui-state-active {
border-bottom: none !important;
background-color: transparent !important;
line-height: 1.8;
}

linha-tempo .ui-tabview-nav {
color: rgba(255, 255, 255, 0.6);
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

linha-tempo .ui-tabview-nav > li {
border: none !important;
width: 150px;
border-radius: 0px 0px 0px 0px !important;
-webkit-border-radius: 0px 0px 0px 0px !important;
-moz-border-radius: 0px 0px 0px 0px !important;
}

linha-tempo .ui-tabview-nav > li.ui-state-active {
color: white;
}

linha-tempo .ui-tabview-nav a {
color: rgba(255, 255, 255, 0.7) !important;
width: 100%;
box-sizing: border-box;
text-align: center;
display: block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

linha-tempo .ui-tabview-nav > li.ui-state-active a {
color: white !important;
border-bottom: 2px solid white;
cursor: default !important;
}

body .ui-tabview .ui-tabview-nav > li.ui-state-hover {
background-color: transparent !important;
}

欢迎任何帮助

最佳答案

我尝试过在点击时左右滚动一个 div。

您也可以对选项卡执行相同的操作。

请查看以下链接以获取详细引用

http://www.w3schools.com/code/tryit.asp?filename=FAB7S70J7UZD

如有任何疑问,请告诉我。

关于javascript - Angular 2 : Programmatically to position inside div overlay,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40902129/

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