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 8365339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:38:02+00:00 2026-06-09T12:38:02+00:00

I have this bar created that slides open when clicked. However, i only want

  • 0

I have this bar created that slides open when clicked. However, i only want it to open when + is clicked. i have the + hyperlinked, but i’m not sure how to make the the slider only respond to the + and bring back the sidebar to normal (right now it is shifted underneath the content div. please help.

    <!DOCTYPE HTML>

<html>
    <head>
        <title>Title</title>
        <link rel="stylesheet" href="style.css">

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">   </script>
    </head>

    <body>

    <div id="wrapper">
        <div id="nav">
        <div id="menu-expand">
        <a href="#" class="closed"><span>+</span></a>
        </div>
        </div>
            <div id="content"></div>
    </div>

    <!-- Scripts -->

<script>
    $(function() {
    $('#nav').click(function() {
        var leftMargin = ($(this).css('margin-left') === '0px') ? '-150px' : '0px';
        $(this).animate({ 'margin-left' : leftMargin }, 500);
    });
});

</script>
    </body>
</html>
  • 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-06-09T12:38:03+00:00Added an answer on June 9, 2026 at 12:38 pm

    The click event ‘bubbles’ up through the DOM, firing on every parent element unless you use ev.stopPropagation():

    $('#nav').click(function(ev) {
        ev.stopPropagation();
        var leftMargin = ($(this).css('margin-left') === '0px') ? '-150px' : '0px';
        $(this).animate({ 'margin-left' : leftMargin }, 500);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tied this jQuery Bar Graph plugin with a function that I created.
I am new to this iphone development.I have created a tab bar application which
I have this script that run to fix my menu bar to the browser
Assume that I have this piece of code: @interface Foo : NSObject { Bar
I have a definition like this def bar(self, foo=None, bar=None, baz=None): pass I want
I have seen this '[A' in a progress bar module but I can't figure
I'm at a loss here. I have this class I've created that takes arguments
I have this jQuery ajax navigation tabs plugin that I created using some help
I have an alert message bar that slides down when the user clicks a
I apologize because this topic comes up a lot, but I have not been

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.