gpt4 book ai didi

css - ApplicationLayout 中的 float 工具栏?

转载 作者:行者123 更新时间:2023-11-28 10:54:21 26 4
gpt4 key购买 nike

请引用this question了解我正在尝试做什么。唯一的异常(exception)是我使用的是 ApplicationLayout,我想要 PlaceBar 下面的工具栏。有没有办法欺骗 CSS 在 PlaceBar 下方显示工具栏,然后在滚动时将其保持在页面顶部? 或者,如何修复 ApplicationLayout 的顶部部分(即 PlaceBar、TitleBar 等...),以便它们也不会滚动?

最佳答案

更新:扩展了这个想法来制作 XSnippet。 Download it from here .

要修复应用程序布局的顶部部分,如位置栏、标题栏,您必须查看应用程序布局控件生成的 HTML 页面的 CSS(Google Chrome 有一个很棒的功能 Inspect Element 为此)。它使用 lotusTitleBarlotusPlaceBarlotusContent 等类,您可以在自定义 CSS 中使用这些类来创建 float 工具栏。

那么让我们假设这是否是您的 XPage,它具有来自扩展库的应用程序布局控制。

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">
<xp:this.resources>
<xp:styleSheet href="/cssAppLayoutFloatingMenu.css"></xp:styleSheet>
</xp:this.resources>
<xe:applicationLayout id="applicationLayout1">
<xp:panel>
Sample Text. 1
<xp:br></xp:br>
Sample Text. 2
<xp:br></xp:br>
Sample Text. 3
<xp:br></xp:br>
Sample Text. 4
</xp:panel>
<xe:this.configuration>
<xe:oneuiApplication titleBarName="Sample Title" placeBarName="Sample Place">
<xe:this.footerLinks>
<xe:basicContainerNode label="Container 1">
<xe:this.children>
<xe:basicLeafNode label="Link 1" href="/"></xe:basicLeafNode>
<xe:basicLeafNode label="Link 2" href="/"></xe:basicLeafNode>
</xe:this.children>
</xe:basicContainerNode>
<xe:basicContainerNode label="Container 2">
<xe:this.children>
<xe:basicLeafNode label="Link 1" href="/"></xe:basicLeafNode>
<xe:basicLeafNode label="Link 2" href="/"></xe:basicLeafNode>
</xe:this.children>
</xe:basicContainerNode>
</xe:this.footerLinks>
<xe:this.placeBarActions>
<xe:pageTreeNode label="Page 1"></xe:pageTreeNode>
<xe:pageTreeNode label="Page 2"></xe:pageTreeNode>
</xe:this.placeBarActions>
</xe:oneuiApplication>
</xe:this.configuration>
</xe:applicationLayout>
</xp:view>

您可以使用此 CSS 使标题栏和位置栏 float

.lotusTitleBar {
/*Class for Title bar*/
position: fixed;
width: 100%;
height: 45px;
z-index: 100;
}
.lotusPlaceBar {
/*Class for Place bar*/
position: fixed;
width: 100%;
z-index: 100;
top: 45px; /*Start after height of lotusTitleBar*/
height: 35px;
}
.lotusContent {
/*Class for Content*/
position: relative;
top: 80px; /*Height of lotusTitleBar + Height of lotusPlaceBar*/
}

注意:这是一个非常基本的例子,只有标题栏和位置栏。如果您在应用程序布局中包含横幅或其他元素,则必须进行相应修改。

关于css - ApplicationLayout 中的 float 工具栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14466384/

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