Advise the ready multi-level horizontal drop-down menu. And tell me how to handle the choice of the menu item? Those. I have say the menu:

продукты | Алкоголь | |.... |___Коньяк |.... |___Пиво |.... |__светлое |__темное 

How do I know what the user is saying that he chose a dark beer and already in the script (python cgi), based on this choice, make a selection from the database?

About how to get the value, came up with this.

 print "<a href=\"?a_graid=test\">aaa</a>" form = cgi.FieldStorage() t = form.getfirst('a_graid', '') print t 
  • And what is the menu implemented on? if on something like HTML / Select, you can do onChange () and then just select by document.getElementById ("element_id"). selectedIndex - pnp2000
  • @ vnn198, I found the menu on jquery + css, called smartmenus, but I have problems with it. Rather, with its display. I should have it displayed in the frame. If I call it outside the frame, then the view is normal horizontal, and if inside the page (inside the frame the page script is loaded), then it goes as a column ... - Sergey White
  • well then you have to look at the documentation of this smartmenus smartmenus.org/docs , as I understand it you need Events / click - pnp2000

2 answers 2

Here is a piece of documentation on the smartmenus

click - Fired when an item is clicked. You can’t be selected, so it’s not. If you want to check it out, check it out. Cancelable: Yes Arguments: e The jQuery.Event object. item The menu item element. Code sample:

 $('#main-menu').bind('click.smapi', function(e, item) {}); 
  • I now need the menu to look fine, I haven’t reached clicks yet. I wrote above that in the frame I have it vertical. I align each li tag, but it looks awful. so I will look for another - Sergey White
  • the formatting of the menu most likely goes via CSS, you can see in the same chrome-> Developer tools (F12) what exactly is leaving and fix it, and click to download your python cgi, you need to call it inside function (e, item) {} - pnp2000
  • la2oldschool.ru//cgi-bin/tradearea/all_lot.cgi it looks like this, if not in the frame. in the frame, the items one under one vertically turn out - Sergey White
  • in sm-blue.css there is a min-width: 768px parameter, apparently you have a frame smaller than this value, set 1px or better select the value in which your menu is guaranteed - pnp2000
  • well yes. I have 700px. I tried to register in the main-menu. Is it necessary to change it in sm-blue.css to change 768 to your own? - Sergey White

the table itself is in CSS and you can add the toggle () property through jquery; which allows you to drop the menu from top to bottom (in this case). And add an onclick () event ;. in general, read about it ... It's very simple literally lines 5 of the code in JS.