简体   繁体   English

Asp.net菜单控件 - 启用标签拖放或滚动

[英]Asp.net Menu Control - enable tab drop or scrolling

I have an asp.net menu control embedded into a div in my website. 我有一个asp.net菜单控件嵌入到我的网站的div中。

My problem is I will have 15 to 20 menus and the menu control looks cluttered when I show all the menus something like the below. 我的问题是我将拥有15到20个菜单,并且在显示所有菜单时,菜单控件看起来很混乱,如下所示。

ASP.NET菜单

I am thinking of applying css to the menu control however i dont know how i can control the amount of items displayed in the menu. 我正在考虑将CSS应用于菜单控件,但是我不知道如何控制菜单中显示的项目数量。 I cant remove the items as they are mandatory. 我不能删除这些项目,因为它们是强制性的。 What I need is the first 5 menu has to be shown and the rest has to be shown in drop down list or with scroller like the below screenshot 我需要的是前5个菜单必须显示,其余的必须显示在下拉列表中或使用滚动条(如以下屏幕截图)显示

I need the menu control to be displayed like the below one 我需要像下面这样显示菜单控件

跳格

or 要么

Arrorw

Can anyone please help me to resolve my issue? 有谁可以帮我解决我的问题?

EDIT 编辑

I have managed to get all the menus in a single row by changing the list style from list to table. 通过将列表样式从列表更改为表格,我设法将所有菜单放在一行中。

菜单

This has solved my clutter issue however the menus are going beyond the div view width. 这解决了我的杂乱问题,但菜单超出了div视图宽度。 I tried changing the width but it didnt helped me. 我尝试改变宽度,但它没有帮助我。 how to set the limit to show only few menus and provide scroll support feature to see the remaining menus. 如何设置限制以仅显示少数菜单并提供滚动支持功能以查看剩余菜单。

ASP.NET菜单滚动

I think you are looking for something like this: http://www.eyecon.ro/bootstrap-tabdrop/ 我想你正在寻找这样的东西: http//www.eyecon.ro/bootstrap-tabdrop/

Let me know if it works out, looks promising, but I never tried it. 让我知道它是否可行,看起来很有希望,但我从未尝试过。

EDIT 编辑

Ok, I tried it. 好的,我尝试了。 If you want to have specifically 5 of them or similar. 如果你想特别有5个或类似的。 You could do something like this in css: 你可以在css中做这样的事情:

ul.nav > li {
  width: 15%; 
}

See fiddle here . 在这里看小提琴。 (Try resizing window) (尝试调整窗口大小)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM