在sharepoint中使用CSS实现Top Link Bars鼠标移过时显示二级菜单

在sharepoint的Top Link Bar,默认情况下会把二级菜单跟一级菜单显示在同一行上,如果下图所示:

CR~@41$)0{_}_C%)H4WA8VA

 

但是实际操作中,我们常常是希望二级菜单能够在鼠标放在一级菜单上时,悬浮显示在一级菜单下面,因此我在master page中加了如下css,实现鼠标放在一级菜单上时显示二级菜单的效果:

<style>
        .menu-horizontal ul.root > li{position:relative;}
        .menu-horizontal ul.root > li > A.static{ float:none;}
        .menu-horizontal ul.root > li ul{ display:none;position:absolute; background-color:rgb(249,249,249);padding-right:20px;padding-top:10px; border-top:1px #e0e0e0 solid;border-bottom:3px #b8babd solid;border-left:1px #e0e0e0 solid;border-right:1px #e0e0e0 solid;}
        .menu-horizontal ul.root > li ul li{float:none;}
        .menu-horizontal ul.root > li ul li > A.static{float:none;}
        .menu-horizontal ul.root > li:hover ul{ display:list-item; }
    </style>

最终显示结果:

DWP2_UPFDTOC]6_7{O4X1ZR

转载于:https://www.cnblogs.com/snailJuan/p/3455570.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在 PowerPoint 使用 VSTO 追加鼠标右键菜单,可以按照以下步骤进行: 1. 在 Visual Studio 创建一个新的 VSTO 项目。 2. 在解决方案资源管理器,右键单击项目并选择“添加”->“新项”。 3. 在“添加新项”对话框,选择“Office 项目”->“PowerPoint 项”,并选择“自定义幻灯片”。 4. 在“自定义幻灯片”对话框,选择“幻灯片”并点击“下一步”。 5. 在“选择项类型”页面,选择“幻灯片窗体”,并点击“下一步”。 6. 在“命名项”页面,为新项命名并点击“完成”。 7. 打开该项的代码视图,在 ThisAddIn.cs 文件,添加以下代码: ``` private void ThisAddIn_Startup(object sender, System.EventArgs e) { Application.WindowBeforeRightClick += new PowerPoint.EApplication_WindowBeforeRightClickEventHandler(Application_WindowBeforeRightClick); } void Application_WindowBeforeRightClick(PowerPoint.Selection Sel, ref bool Cancel) { if (Sel.Type == PowerPoint.PpSelectionType.ppSelectionShapes) { PowerPoint.ShapeRange shapeRange = Sel.ShapeRange; if (shapeRange.Count == 1) { PowerPoint.CommandBarPopup popup = (PowerPoint.CommandBarPopup)Application.CommandBars["Shape"].Controls.Add(MsoControlType.msoControlPopup, missing, missing, missing, true); popup.Caption = "My Custom Menu"; PowerPoint.CommandBarButton button = (PowerPoint.CommandBarButton)popup.Controls.Add(MsoControlType.msoControlButton, missing, missing, missing, true); button.Caption = "My Custom Command"; button.Click += new _CommandBarButtonEvents_ClickEventHandler(button_Click); } } } void button_Click(CommandBarButton Ctrl, ref bool CancelDefault) { MessageBox.Show("My Custom Command was clicked"); } ``` 上述代码,我们通过 ThisAddIn_Startup 事件处理程序,订阅了 Application.WindowBeforeRightClick 事件。在 Application_WindowBeforeRightClick 事件处理程序,我们检查当前选择是否为形状,并创建一个自定义弹出菜单和一个自定义命令按钮。当用户单击自定义命令按钮时,会触发 button_Click 事件处理程序,弹出一个消息框。 现在,您可以运行该项目,打开 PowerPoint 并尝试右键单击一个形状,您将看到自定义的菜单和命令按钮。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值