Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7546047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:05:53+00:00 2026-05-30T09:05:53+00:00

/* ========== Expand Left Menu ========== */ $(‘div.minimized’).click(function() { $(this).removeClass(minimized); $(this).addClass(expanded); $(‘a.main_nav’).removeClass(min); $(‘a.main_nav’).addClass(exp); $(‘#left_menu_ul

  • 0
/* ========== Expand Left Menu ========== */
    $('div.minimized').click(function() {
        $(this).removeClass("minimized");
        $(this).addClass("expanded");
        $('a.main_nav').removeClass("min");
        $('a.main_nav').addClass("exp");
        $('#left_menu_ul li a').animate({"margin-left" : "-20px"}, 400, 'easeOutExpo');
        $('#expand_wrapper').animate({"width" : "270px"}, 400, 'easeOutExpo');
        $('#expand').animate({"left" : "227px"}, 400, 'easeOutExpo');
        $('#left_menu').animate({"width" : "270px"}, 400, 'easeOutExpo');
    });

    /* ========== Minimize Left Menu ========== */      
    $('div.expanded').click(function() {            
        $(this).removeClass("expanded");
        $(this).addClass("minimized");
        $('a.main_nav').removeClass("exp");
        $('a.main_nav').addClass("min");
        $('#expand_wrapper').removeAttr('style');
        $('#left_menu_ul li a').animate({"margin-left" : "-223px"}, 800, 'easeInExpo');
        $('#expand_wrapper').animate({"width" : "67px"}, 800, 'easeInExpo');
        $('#expand').animate({"left" : "26px"}, 800, 'easeInExpo');
        $('#left_menu').animate({"width" : "67px"}, 800, 'easeInExpo');
    });

I am new to jQuery and I have a problem that I am unable to solve:
I want to expand a vertical menu. The code that expands the menu works fine, but after the menu is expanded (the classes change), jQuery is unable to select $('div.expanded').
Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:05:54+00:00Added an answer on May 30, 2026 at 9:05 am

    Your problem is that you are using the old way of attaching event handlers, which relies on the element existing when the handler is set up. Change your .click() to .on(‘click’) and it will fix the problem.

    jQuery on

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like that: <div style=width:100px;float:left>menu</div> <div style=float:left>content</div> both floats are neccesary. I
Any idea how I can get a category menu that expand when you click
This question will expand on: Best way to open a socket in Python When
I'm trying to expand navigation options of the context menu on certain elements (specifically,
I want to expand on the functionality related to this question . Is there
HTML page has a background image. Nav menu on left expands on hover to
My goals: I want to have #nav to be divide into menu-left and menu-right,
How can I get the nav div to have expand down or have the
I have a layout with a variable-length menu on the left, and variable-length content
I would like to make a li element expand from right to left. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.