JavaScript jquery div show and hide problems jquery show hide div,jquery show hide toggle,jquery show

I have a problem. When I first time press on the link div show's then when I press on document it's disappear. When I press second time on link div appears and suddenly disappears. What's wrong?

$(function() {
$("#trigger").click(function() {
    $('#toolWrapper').toggle(function() {
        $(document).click(function(event) {
            if (!($(event.target).is('#toolWrapper') || $(event.target).parents('#toolWrapper').length || $(event.target).is('#trigger'))) {
                $('#toolWrapper').hide(500);
                event.preventDefault();
            }
        });
    });
});

});

Answer:1

I've been going crazy trying to figure this one out. I've seen plenty of obfuscated and tough-to-implement examples of filling a computed observable in Knockout when an async call has finished, but I ...

I've been going crazy trying to figure this one out. I've seen plenty of obfuscated and tough-to-implement examples of filling a computed observable in Knockout when an async call has finished, but I ...

I'm trying to make a .jsp where, by clicking a button, the page opens a modal dialog with some stuff. I'm also using jQuery. I'm new to this, so, to test if jQuery was working, I first tried a kind of ...

I'm trying to make a .jsp where, by clicking a button, the page opens a modal dialog with some stuff. I'm also using jQuery. I'm new to this, so, to test if jQuery was working, I first tried a kind of ...

I'm learning Angular but having troubles to understand a point. I want to get data from my server. I used this code (from angular's doc) : this.myFunction = new function() { var uri = this....

I'm learning Angular but having troubles to understand a point. I want to get data from my server. I used this code (from angular's doc) : this.myFunction = new function() { var uri = this....

  1. understanding angular momentum
  2. understanding angular.json
  3. understanding angular modules
  4. understanding angularjs
  5. understanding angular observables
  6. understanding angular routing
  7. understanding angular 8
  8. understanding angular lifecycle hooks
  9. understanding angular dependency injection
  10. understanding angular project structure
  11. understanding angular components
  12. understanding angular directives
  13. understanding angular error messages
  14. understanding angular services
  15. understanding angular change detection
  16. understanding angularjs digest life-cycle
  17. understanding angular architecture
  18. understanding angular source code
  19. understanding angular reactive forms

I am using Jquery to making drag and drop. My short javascript to make an item to drag is: $(".draggable").draggable(); My short javascript to make a dropable area is: $("#droppable").droppable(); ...

I am using Jquery to making drag and drop. My short javascript to make an item to drag is: $(".draggable").draggable(); My short javascript to make a dropable area is: $("#droppable").droppable(); ...

  1. drag using jquery