Guest User

Untitled

a guest
Feb 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. var current_shown = null;
  3. var mouse_is_inside = false;
  4.  
  5. $().ready(function() {
  6.     $('.priv_choser').click(function(){
  7.           var offset = $(this).offset();
  8.         if(current_shown == null || current_shown != $(this).attr('id')) {
  9.           current_shown = $(this).attr('id');
  10.           jQuery(".priv_choose_toolbox").css("top", $(this).height()+offset.top+4);
  11.           jQuery(".priv_choose_toolbox").css("left", offset.left);
  12.           $(".priv_choose_toolbox").show();
  13.         }
  14.         else {
  15.             $(".priv_choose_toolbox").hide();
  16.             current_shown = null;
  17.         }
  18.     });
  19.    
  20.     $('.priv_choose_toolbox').hover(function(){
  21.         mouse_is_inside=true;
  22.     }, function(){
  23.         mouse_is_inside=false;
  24.     });
  25.  
  26.     $("body").mouseup(function(){
  27.         if(! mouse_is_inside) {
  28.             if(current_shown != null) {
  29.                 $('.priv_choose_toolbox').hide();
  30.                 current_shown = null;
  31.             }
  32.         }
  33.     });
  34.    
  35. });
Add Comment
Please, Sign In to add comment