Deprecated: Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead. in /var/www/html/wp-includes/functions.php on line 5383

Reply To: Sub-menu alignment

New Front EN Support Forums Reply To: Sub-menu alignment


Hey Credo,

I cannot think of a way to implement it via pure CSS, since the submenus are absolutely-positioned, and the window width is different for every new user. The only way to achieve the container alignment that I could think of is by using some additional jQuery to set the left-padding for the first “li” element of every submenu to half of the difference between the widths of the window and the container – something like this (not tested):

var $subpad = jQuery.noConflict();
$subpad(document).ready(function() {
   var leftpadding = $subpad(window).width() - $subpad('.container').width();
   $subpad('#nav-primary ul ul li:first-child').css('padding-left',leftpadding);

Andrii / Satori Studio