jQWidgets Forums
jQuery UI Widgets › Forums › Navigation › Menu, Context Menu › jqxmenu – no wrap text in menu item
Tagged: jqxmenu item-menu text wrap
This topic contains 2 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 9 months ago.
-
Author
-
Hi,
I am using JQWidgets menu.
My problem is with menu item when their text is long. It is wrapped by default.
I don’t want text to be wrapped.Drop-down width seems to be 280px by default.
I saw a partial solution saying to set the css width of each “ul” tag.
Only problem with that is when font-size change in theme : ul size is not updated acordly and text could wrap again.
This means maintenance time to adjust each menu.This is my basic exemple :
<html> <head> <title></title> <script type="text/javascript" src="Js/jquery.min.js"></script> <script type="text/javascript" src="Js/jquery-ui-1.10.2.custom.min.js"></script> <script type="text/javascript" src="Js/jqxcore.js"></script> <script type="text/javascript" src="Js/jqxmenu.js"></script> <link rel="stylesheet" href="css/jqx.base.css" media="screen" /> <script type="text/javascript"> $(document).ready(function () { $("#JQWidgetsMenu").jqxMenu({ animationShowDuration: 0, animationHideDuration: 0, animationShowDelay: 0, showTopLevelArrows: true, }); }); </script> </head> <body> <br> <div id='JQWidgetsMenu' style="height: 25px; width: 200px"> <ul> <li>Main element <ul style='/* width: 200px; */'> <li><a href="javascript:">Short text</a></li> <li id="OneLI"><a href="javascript:">A long text...............end</a></li> <li><a href="javascript:" id="E10_MenuJQWidgetsOuvrirEcranPays">With sub-menu</a> <ul> <li><a href="javascript:">Another short text</a></li> <li><a href="javascript:">Another long text...............end</a></li> </ul> </li> </ul> </li> </ul> </div> </body></html>
Do you know a way for drop-down to automatically resize depending on longer text in the menu ?
Thanks.
Alain.
Hi,
Any idea to have drop-down in a menu resized to the longer item menu ?
(without wrapping item menu text)Thanks.
Alain.
Hi Alain,
You may set the DropDown’s Width through CSS – see the commented code in your post which sets it.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.