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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:46:28+00:00 2026-06-05T12:46:28+00:00

var bar = $(‘.div_layer_Class’); $(‘a.second_line’).click(function() { $(this).unbind(‘mouseout’); }).mouseover(function() { bar.css(‘display’,’inline’); }).mouseout(function() { bar.css(‘display’,’none’); });

  • 0
var bar = $('.div_layer_Class');
  $('a.second_line').click(function() {
      $(this).unbind('mouseout');
  }).mouseover(function() {
      bar.css('display','inline');
  }).mouseout(function() {
      bar.css('display','none');
  });

now the issue with ‘onBodyclick’ when i click anywhere on body again i want to invoke mouseoutevent something like this

$('body').click(function() {
      bar.css('display','none');
 event.preventDefault();

  });

when I do this it overlaps $('a.second_line').click(function() event. any idea how I can Achieve this.

http://jsfiddle.net/qGJH4/56/

  • 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-05T12:46:30+00:00Added an answer on June 5, 2026 at 12:46 pm

    Example here
    Try changing your code to this

    var bar = $('.div_layer_Class');
    $('a.second_line').click(function(e) {
        bar.addClass('on');
        e.stopPropagation();
    }).mouseover(function() {
        bar.css('display','inline');
    }).mouseout(function() {
       if(!bar.hasClass('on'))
           bar.css('display','none');
    });
    
    $(document).on('click',function(){
      bar.removeClass('on');
      bar.css('display','none');
      //return false;
    });
    

    Two lines to look at, first, the e in function(e)

    $('a.second_line').click(function(e) {
    

    and the stop e.stopPropagation();

    That basically stops any parent handlers being notified. Read here

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

Sidebar

Related Questions

This is an example of my code: var bar = function() { this.baz =
Consider this javascript code: var bar = function () { alert(A); } var foo
function foo() {} var bar = foo <| function() {}; This is the first
Consider this contrived, trivial example: var foo = new byte[] {246, 127}; var bar
I show us the code: (function (){ var element = document.getElementById('bar'), hideElement = document.getElementById('foo'),
In the code: slider.init({ foo: bar }); var slider={ init:function(data){ } } If I
Let us say I have the following: var foo = (function(){ var bar =
class Foo(@BeanProperty var bar:String) { def setBar(d:Double) { bar = d.toString } } This
I've seen others using the following pattern. var bar = function foo(){}; console.log(bar); //
I'd like to do something like this: var foo = function(){ this.value = 1;

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.