Register the click event only to the #toggle-pane
element and then inside find the cbp-vimenu
element and toggle its class
$("#toggle-pane").click(function () {
$('.cbp-vimenu').toggleClass("menu-min");
//or $(this).closest('.cbp-vimenu').toggleClass("menu-min");
//I don't think you want to use closest since it doesn't look like you have many elements with class cbp-vimenu
});