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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:57:21+00:00 2026-05-27T09:57:21+00:00

I have a script here that if i click on it drops down, as

  • 0

I have a script here that if i click on it drops down, as well on if i clickoutside it drops down. But i want to make it so that if i click on bottom it scrolls up. For some reason it doesnt work here. It only scrolls up if i click outside the box.

Heres an example. http://jsfiddle.net/w8mfx/

If i click on bottom it wont scroll up only if i click on outside. But i want it to work both ways.

$(document).ready(function() {
    $('#bottom').click(function(event) {
    event.stopPropagation();
    $('#content').slideDown();

});

    $('html').click(function(e) {
        //alert(1);
        if (e.target.id != 'bottom') {
            $('#content').slideUp();
        }
    });
});
  • 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-27T09:57:22+00:00Added an answer on May 27, 2026 at 9:57 am

    http://jsfiddle.net/w8mfx/7/

    I added:

    $('#content').click(function (event) {
        event.stopPropagation();
    });
    

    so the user can click on the #content element and not trigger the slide function. That also means that the event handler for the html element can be simpler:

    $('html').click(function(e) {
        $('#content').slideUp();
    });
    

    In the jsfiddle you may notice I cached the $('#content') selector in a variable since it was being used in more than one place.

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

Sidebar

Related Questions

I'm writing a script that will ping my ip range. Here's what I have
Here is my script... all I want to do is have it continuously loop!
I'm have some trouble with the fulltext CONTAINS operator. Here's a quick script to
I have a javascript code here that on click one pulls one function and
I have a jQuery script that basically is changing my css when I click
ok so i have a script that when you click a link it dynamicly
Just wondering what little scripts/programs people here have written that helps one with his
I have a host with php+mysql and i need to run a script here
Here's a snippet of code from a shell script I have written: for src
I have a problem here. My Zend_Forms do not render in view script. Via

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.