var activeClass = 'openToggler', showingDropdown, showingMenu, showingParent;    /* hides the current menu */    var hideMenu = function () {        if (showingDropdown) {            showingDropdown.removeClass(activeClass);            showingMenu = false;        }    };    /* recurse through dropdown menus */    $('.smthing').each(function () {        /* track elements: menu, parent */        var dropdown = $(this);        parent = dropdown.parent();        dropdown.find('a.btn').click(function () {            var showMenu = function () {                hideMenu();                showingDropdown = dropdown.addClass(activeClass);                showingMenu = true;                showingParent = parent;            };            /* function to show menu when clicked */            $(this).bind('click', function (e) {                if (e) e.stopPropagation();                //if (e) e.preventDefault();                showMenu();            });            /* function to show menu when someone tabs to the box */            $(this).bind('focus', function () {                showMenu();            });        });    });    /* hide when clicked outside */    $('body').bind('click', function (e) {        if (showingParent) {            var parentElement = showingParent[0];            if (!$.contains(parentElement, e.target) || !parentElement == e.target) {                hideMenu();            }        }    });I am wondering if there's a way to optimize this piece of code and make it run efficiently and smoothly.
Can this be optimized to perform smoothly?
jquery;optimization