Guest User

Untitled

a guest
Oct 19th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $('.msg_id').live("mouseover", function() {
  2.     $(this).css('cursor', 'pointer');
  3.     tid = $(this).attr('id');
  4.     idx = $(this).attr('name');
  5.     mDiv = $(this);
  6.     $.post("log_msg.asp", $("#msgForm").serialize() + "&aktion=popup&msg_id="+tid+"&msg_id"+idx,
  7.         function(data) {       
  8.           $("#"+tid).html(data);    
  9.         }).success(function(){
  10.              console.log(mDiv);
  11.              popd = $('.popup-div', mDiv);
  12.              console.log(popd);
  13.              //$('#bub'+tid).css('display', 'block');  
  14.              popd.css('display', 'block'); 
  15.             });
  16.     });
  17.  
  18.  
  19. ------------------------------------------------------------------------------------------------
  20.  
  21. this inserts:
  22. <div id="bub4823401" class="bubbleInfo">
  23. <div class="trigger">&nbsp;</div>
  24. <div class="popup-div" style="display: block;">
  25. <table id="dpop" class="popup" style="opacity: 0; display: none;">
  26. <tbody>
  27. <tr> <!-- C U T  -></tr>
  28. </tbody>
  29. </table>
  30. </div>
  31. </div>
  32.  
  33. ------------------------------------------------------------------------------------------------
  34.    $('.bubbleInfo').live("mouseover mouseout", function(event) {
  35.         var distance = -10;
  36.         var time = 250;
  37.         var hideDelay = 0;
  38.  
  39.         var hideDelayTimer = null;
  40.  
  41.         var beingShown = false;
  42.         var shown = false;
  43.         var trigger = $('.trigger', this);
  44.         var info = $('.popup', this).css('opacity', 0);
  45.                 var popd = $('.popup-div', this);
  46.         if ( event.type == "mouseover" ) {        
  47.             $([trigger.get(0), info.get(0)]).mouseover(function ()
  48.              {  
  49.                 //var poppos = this.position();  
  50.                 var pdpos = popd.position().top;
  51.                 var pdpos2 = popd.offset().top;
  52.                 //var bott =  $(document).height() - poppos.top;
  53.                             var p = $(window).height() - pdpos;
  54.                             var infoh = info.height();
  55.                          
  56.                             popd.css("top", pdpos);
  57.                             if(p < infoh)
  58.                             {
  59.                                 //popd.css("top", pdpos - infoh );
  60.                             }
  61.                              
  62.                 if (hideDelayTimer) clearTimeout(hideDelayTimer);
  63.                 if (beingShown || shown) {
  64.                     // don't trigger the animation again
  65.                     return;
  66.                 } else {
  67.                     // reset position of info box
  68.                     beingShown = true;         
  69.                     info.css({          
  70.                         display: 'block'                       
  71.                     }).animate({                      
  72.                        
  73.                         opacity: 1
  74.                     }, time, 'swing', function() {
  75.                         beingShown = false;
  76.                         shown = true;
  77.                     });
  78.                
  79.                 }
  80.            
  81.                 return false;  
  82.                     });
  83.       }
  84.         if ( event.type == "mouseout" ) {  
  85.         //.mouseout(function () {
  86.             if (hideDelayTimer) clearTimeout(hideDelayTimer);
  87.             hideDelayTimer = setTimeout(function () {
  88.                 hideDelayTimer = null;
  89.                 info.animate({
  90.                     //top: '=' + distance + 'px',
  91.                     opacity: 0
  92.                 }, time, 'swing', function () {
  93.                     shown = false;
  94.                     info.css('display', 'none');
  95.                    
  96.                 });
  97.  
  98.             }, hideDelay);
  99.  
  100.             return false;
  101.           }
  102.         });
Add Comment
Please, Sign In to add comment