Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var current_shown = null;
- var mouse_is_inside = false;
- $().ready(function() {
- $('.priv_choser').click(function(){
- var offset = $(this).offset();
- if(current_shown == null || current_shown != $(this).attr('id')) {
- current_shown = $(this).attr('id');
- jQuery(".priv_choose_toolbox").css("top", $(this).height()+offset.top+4);
- jQuery(".priv_choose_toolbox").css("left", offset.left);
- $(".priv_choose_toolbox").show();
- }
- else {
- $(".priv_choose_toolbox").hide();
- current_shown = null;
- }
- });
- $('.priv_choose_toolbox').hover(function(){
- mouse_is_inside=true;
- }, function(){
- mouse_is_inside=false;
- });
- $("body").mouseup(function(){
- if(! mouse_is_inside) {
- if(current_shown != null) {
- $('.priv_choose_toolbox').hide();
- current_shown = null;
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment