New Front EN › Support Forums › Reply To: Sub-menu alignment
February 18, 2014 at 1:19 pm
#2555
satori
Keymaster
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);
});
Sincerely,
Andrii / Satori Studio