How to add .active class in to the menu item?
You can achieve your goal without jQuery. Just use theme_menu_link() function, or (my suggestion) theme_menu_link__your_menu()

Place this function in your template.php file:

function YOURTHEME_menu_link(array $variables) {
    $element = $variables['element'];
    $sub_menu = '';

    if ($element['#below']) {
        $sub_menu = drupal_render($element['#below']);
    }
    $output = l($element['#title'], $element['#href'], $element['#localized_options']);

    // if link class is active, make li class as active too
    if(strpos($output,"active")&gt;0){
        $element['#attributes']['class'][] = "active";
    }
    return '&lt;li' . drupal_attributes($element['#attributes']) . '&gt;' . $output . $sub_menu . "&lt;/li&gt;\n";
}


You can use this function only for menus displayed as a block. 
If you're theming main menu:


go to admin/appearance/settings/yourtheme and turn the main menu off.
go to admin/structure/block and place main menu block in header region
customize ul with theme_menu_tree() and li elements with theme_menu_link()